aboutsummaryrefslogtreecommitdiff
path: root/man/man3
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-06-26 05:47:59 +0000
committerrsc <devnull@localhost>2006-06-26 05:47:59 +0000
commitdf970459f9b37386fbfd4b7f3646825c8029caa8 (patch)
tree80d24bf50aed788e382e876177e0fb30006148bc /man/man3
parentf936548b5e1dc6cff6e422867a4265c64ebbcfd1 (diff)
downloadplan9port-df970459f9b37386fbfd4b7f3646825c8029caa8.tar.gz
plan9port-df970459f9b37386fbfd4b7f3646825c8029caa8.tar.bz2
plan9port-df970459f9b37386fbfd4b7f3646825c8029caa8.zip
pin
Diffstat (limited to 'man/man3')
-rw-r--r--man/man3/thread.318
1 files changed, 18 insertions, 0 deletions
diff --git a/man/man3/thread.3 b/man/man3/thread.3
index 92abb3f3..5145a543 100644
--- a/man/man3/thread.3
+++ b/man/man3/thread.3
@@ -37,6 +37,8 @@ threadmain,
threadnotify,
threadid,
threadpid,
+threadpin,
+threadunpin,
threadsetgrp,
threadsetname,
threadsetstate,
@@ -84,6 +86,8 @@ int threadcreate(void (*fn)(void*), void *arg, uint stacksize)
void threadexits(char *status)
void threadexitsall(char *status)
void yield(void)
+int threadpin(void)
+int threadunpin(void)
.XX
int threadid(void)
int threadgrp(void)
@@ -260,6 +264,20 @@ System calls such as
block the entire proc;
all threads in a proc block until the system call finishes.
.PP
+.I Threadpin
+disables scheduling inside a proc, `pinning' the current
+thread as the only runnable one in the current proc.
+.I Threadunpin
+reenables scheduling, allowing other procs to run once the current
+thread relinquishes the processor.
+.I Threadpin
+and
+.I threadunpin
+can lead to deadlock.
+Used carefully, they can make library routines that use
+.B qlocks
+appear atomic relative to the current proc, like a system call.
+.PP
As mentioned above, each thread has a unique integer thread id.
Thread ids are not reused; they are unique across the life of the program.
.I Threadid