summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_gc.c')
-rw-r--r--lib/libpthread/thread/thr_gc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_gc.c b/lib/libpthread/thread/thr_gc.c
index f297fa8..510c51f 100644
--- a/lib/libpthread/thread/thr_gc.c
+++ b/lib/libpthread/thread/thr_gc.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: uthread_gc.c,v 1.1 1998/09/30 06:36:56 jb Exp $
+ * $Id: uthread_gc.c,v 1.2 1998/09/30 19:17:51 dt Exp $
*
* Garbage collector thread. Frees memory allocated for dead threads.
*
@@ -47,6 +47,7 @@ _thread_gc(pthread_addr_t arg)
int f_debug;
int f_done = 0;
int ret;
+ sigset_t mask;
pthread_t pthread;
pthread_t pthread_cln;
pthread_t pthread_nxt;
@@ -54,6 +55,13 @@ _thread_gc(pthread_addr_t arg)
struct timespec abstime;
void *p_stack;
+ /* Block all signals */
+ sigfillset (&mask);
+ sigprocmask (SIG_BLOCK, &mask, NULL);
+
+ /* Mark this thread as a library thread (not a user thread). */
+ _thread_run->flags |= PTHREAD_FLAGS_PRIVATE;
+
/* Set a debug flag based on an environment variable. */
f_debug = (getenv("LIBC_R_DEBUG") != NULL);
OpenPOWER on IntegriCloud