From 32eefeb935d95a67efef35682775d19eacb04ae6 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 14 Dec 2005 06:07:55 +0000 Subject: add pthread_cleanup_push and pthread_cleanup_pop --- lib/librthread/rthread.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/librthread/rthread.h') 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 * 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 -- cgit v1.2.3