diff options
author | Russ Cox <rsc@swtch.com> | 2020-12-30 00:10:11 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2020-12-30 00:12:14 -0500 |
commit | b3a20a96eb2b91a5b0b8a8fb506e20a2fb50ebe8 (patch) | |
tree | 0cebec89bb62594af9c5310e1ba99a4dee65b51b /include | |
parent | 5b37d9126474864b5299426e27b2af37fcc96dd0 (diff) | |
download | plan9port-b3a20a96eb2b91a5b0b8a8fb506e20a2fb50ebe8.tar.gz plan9port-b3a20a96eb2b91a5b0b8a8fb506e20a2fb50ebe8.tar.bz2 plan9port-b3a20a96eb2b91a5b0b8a8fb506e20a2fb50ebe8.zip |
libthread: add threadmaybackground
Programs that want to background themselves now need
to define threadmaybackground returning 1.
This avoids a confusing (to people and debuggers)
extra parent process for all the threaded programs
that will never want to background themselves.
Diffstat (limited to 'include')
-rw-r--r-- | include/thread.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/thread.h b/include/thread.h index c01cd516..8c800829 100644 --- a/include/thread.h +++ b/include/thread.h @@ -1,7 +1,7 @@ #ifndef _THREAD_H_ #define _THREAD_H_ 1 #if defined(__cplusplus) -extern "C" { +extern "C" { #endif AUTOLIB(thread) @@ -15,6 +15,7 @@ void threadexits(char *); void threadexitsall(char *); void threadsetname(char*, ...); void threadsetstate(char*, ...); +void threadneedbackground(void); char *threadgetname(void); int threadyield(void); int threadidle(void); @@ -60,6 +61,8 @@ void **threaddata(void); void threadmain(int argc, char *argv[]); extern int mainstacksize; +int threadmaybackground(void); + /* * channel communication */ @@ -180,7 +183,7 @@ int threadspawnl(int[3], char*, ...); Channel* threadwaitchan(void); /* - * alternate interface to threadwaitchan - don't use both! + * alternate interface to threadwaitchan - don't use both! */ Waitmsg* procwait(int pid); |