3 * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
6 * Redistribution and use in source and binary forms are permitted only
7 * as authorized by the OpenLDAP Public License. A copy of this
8 * license is available at http://www.OpenLDAP.org/license.html or
9 * in file LICENSE in the top-level directory of the distribution.
12 /* thr_thr.c - wrappers around solaris threads */
16 #if defined( HAVE_THR )
18 #include "ldap_pvt_thread.h"
27 ldap_int_thread_initialize( void )
33 ldap_int_thread_destroy( void )
38 #ifdef LDAP_THREAD_HAVE_SETCONCURRENCY
40 ldap_pvt_thread_set_concurrency(int n)
42 return thr_setconcurrency( n );
46 #ifdef LDAP_THREAD_HAVE_GETCONCURRENCY
48 ldap_pvt_thread_get_concurrency(void)
50 return thr_getconcurrency();
55 ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
57 void *(*start_routine)( void *),
60 return( thr_create( NULL, 0, start_routine, arg,
61 detach ? THR_DETACHED : 0,
66 ldap_pvt_thread_exit( void *retval )
71 int ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
73 thr_join( thread, NULL, thread_return );
78 ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
80 thr_kill( thread, signo );
85 ldap_pvt_thread_yield( void )
92 ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
94 return( cond_init( cond, USYNC_THREAD, NULL ) );
98 ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
100 return( cond_signal( cond ) );
104 ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cv )
106 return( cond_broadcast( cv ) );
110 ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
111 ldap_pvt_thread_mutex_t *mutex )
113 return( cond_wait( cond, mutex ) );
117 ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cv )
119 return( cond_destroy( cv ) );
123 ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
125 return( mutex_init( mutex, USYNC_THREAD, NULL ) );
129 ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
131 return( mutex_destroy( mutex ) );
135 ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
137 return( mutex_lock( mutex ) );
141 ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
143 return( mutex_unlock( mutex ) );
147 ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mp )
149 return( mutex_trylock( mp ) );
152 #endif /* HAVE_THR */