MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _cpuset_setthread

Function _cpuset_setthread

freebsd/kern/kern_cpuset.c:1467–1497  ·  view source on GitHub ↗

* Apply an anonymous mask or a domain to a single thread. */

Source from the content-addressed store, hash-verified

1465 * Apply an anonymous mask or a domain to a single thread.
1466 */
1467static int
1468_cpuset_setthread(lwpid_t id, cpuset_t *mask, struct domainset *domain)
1469{
1470 struct setlist cpusets;
1471 struct domainlist domainlist;
1472 struct cpuset *nset;
1473 struct cpuset *set;
1474 struct thread *td;
1475 struct proc *p;
1476 int error;
1477
1478 cpuset_freelist_init(&cpusets, 1);
1479 domainset_freelist_init(&domainlist, domain != NULL);
1480 error = cpuset_which(CPU_WHICH_TID, id, &p, &td, &set);
1481 if (error)
1482 goto out;
1483 set = NULL;
1484 thread_lock(td);
1485 error = cpuset_shadow(td->td_cpuset, &nset, mask, domain,
1486 &cpusets, &domainlist);
1487 if (error == 0)
1488 set = cpuset_update_thread(td, nset);
1489 thread_unlock(td);
1490 PROC_UNLOCK(p);
1491 if (set)
1492 cpuset_rel(set);
1493out:
1494 cpuset_freelist_free(&cpusets);
1495 domainset_freelist_free(&domainlist);
1496 return (error);
1497}
1498
1499/*
1500 * Apply an anonymous mask to a single thread.

Callers 3

cpuset_setthreadFunction · 0.85
cpuset_setithreadFunction · 0.85
kern_cpuset_setdomainFunction · 0.85

Calls 8

cpuset_freelist_initFunction · 0.85
domainset_freelist_initFunction · 0.85
cpuset_whichFunction · 0.85
cpuset_shadowFunction · 0.85
cpuset_update_threadFunction · 0.85
cpuset_relFunction · 0.85
cpuset_freelist_freeFunction · 0.85
domainset_freelist_freeFunction · 0.85

Tested by

no test coverage detected