diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1996-06-10 11:58:20 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1996-06-10 11:58:20 -0400 |
commit | f2433f89b4dc7b7fb0661d3d5ce50eb6c1d9777c (patch) | |
tree | 95a5c00e9d74a1fc520a893642990af65c712d13 /gcc/objc | |
parent | 8c3f352664c7ad286ae2dcf54e82737827a6d7ba (diff) | |
download | gcc-f2433f89b4dc7b7fb0661d3d5ce50eb6c1d9777c.zip gcc-f2433f89b4dc7b7fb0661d3d5ce50eb6c1d9777c.tar.gz gcc-f2433f89b4dc7b7fb0661d3d5ce50eb6c1d9777c.tar.bz2 |
(objc_set_thread_callback): New function.
(objc_thread_callback): Typedef for the hook function.
From-SVN: r12260
Diffstat (limited to 'gcc/objc')
-rw-r--r-- | gcc/objc/thr.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/objc/thr.h b/gcc/objc/thr.h index 9cc81f5..faf797b 100644 --- a/gcc/objc/thr.h +++ b/gcc/objc/thr.h @@ -75,6 +75,21 @@ _objc_thread_t objc_thread_detach(SEL selector, id object, id argument); int objc_mutex_lock_x(_objc_mutex_t mutex, const char *f, int l); int objc_mutex_unlock_x(_objc_mutex_t mutex, const char *f, int l); +/* + Use this to set the hook function that will be called when the + runtime initially becomes multi threaded. + The hook function is only called once, meaning only when the + 2nd thread is spawned, not for each and every thread. + + It returns the previous hook function or NULL if there is none. + + A program outside of the runtime could set this to some function so + it can be informed; for example, the GNUstep Base Library sets it + so it can implement the NSBecomingMultiThreaded notification. + */ +typedef void (*objc_thread_callback)(); +objc_thread_callback objc_set_thread_callback(objc_thread_callback func); + /* For debugging of locks, uncomment these two macros: */ /* #define objc_mutex_lock(x) objc_mutex_lock_x(x, __FILE__, __LINE__) */ /* #define objc_mutex_unlock(x) objc_mutex_unlock_x(x, __FILE__, __LINE__)*/ |