diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2005-12-14 06:07:55 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2005-12-14 06:07:55 +0000 |
commit | 32eefeb935d95a67efef35682775d19eacb04ae6 (patch) | |
tree | 2330d85b954a8e5062e1a65cb3ddd0864fc2d5d8 /lib/librthread/rthread.h | |
parent | 6ae4e33cbd86dce56e7209b706f25a96c5cc827c (diff) |
add pthread_cleanup_push and pthread_cleanup_pop
Diffstat (limited to 'lib/librthread/rthread.h')
-rw-r--r-- | lib/librthread/rthread.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/librthread/rthread.h b/lib/librthread/rthread.h index 6eac065dbcd..8b1290dbe79 100644 --- a/lib/librthread/rthread.h +++ b/lib/librthread/rthread.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread.h,v 1.5 2005/12/14 04:43:04 tedu Exp $ */ +/* $OpenBSD: rthread.h,v 1.6 2005/12/14 06:07:54 tedu Exp $ */ /* * Copyright (c) 2004 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -83,6 +83,12 @@ struct rthread_storage { void *data; }; +struct rthread_cleanup_fn { + void (*fn)(void *); + void *arg; + struct rthread_cleanup_fn *next; +}; + struct pthread { pid_t tid; struct semaphore donesem; @@ -97,6 +103,7 @@ struct pthread { struct sched_param sched_param; struct rthread_storage *local_storage; int sigpend; + struct rthread_cleanup_fn *cleanup_fns; }; #define THREAD_DONE 0x001 #define THREAD_DETACHED 0x002 |