1999-09-09 03:06:24 +08:00
|
|
|
/* $OpenLDAP$ */
|
1999-01-17 23:46:19 +08:00
|
|
|
/*
|
2003-01-04 04:20:47 +08:00
|
|
|
* Copyright 1998-2003 The OpenLDAP Foundation, Redwood City, California, USA
|
1999-01-17 23:46:19 +08:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms are permitted only
|
|
|
|
* as authorized by the OpenLDAP Public License. A copy of this
|
|
|
|
* license is available at http://www.OpenLDAP.org/license.html or
|
|
|
|
* in file LICENSE in the top-level directory of the distribution.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* thr_stub.c - stubs for the threads */
|
1999-01-15 22:54:25 +08:00
|
|
|
|
|
|
|
#include "portable.h"
|
|
|
|
|
|
|
|
#if defined( NO_THREADS )
|
|
|
|
|
2000-06-13 10:42:13 +08:00
|
|
|
#include "ldap_pvt_thread.h"
|
1999-06-01 03:59:29 +08:00
|
|
|
|
1999-01-15 22:54:25 +08:00
|
|
|
/***********************************************************************
|
|
|
|
* *
|
|
|
|
* no threads package defined for this system - fake ok returns from *
|
|
|
|
* all threads routines (making it single-threaded). *
|
|
|
|
* *
|
|
|
|
***********************************************************************/
|
|
|
|
|
1999-01-28 12:34:55 +08:00
|
|
|
int
|
2000-06-07 03:59:34 +08:00
|
|
|
ldap_int_thread_initialize( void )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-04-07 05:57:16 +08:00
|
|
|
int
|
2000-06-07 03:59:34 +08:00
|
|
|
ldap_int_thread_destroy( void )
|
1999-04-07 05:57:16 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-01-28 12:34:55 +08:00
|
|
|
static void* ldap_int_status = NULL;
|
1999-01-15 22:54:25 +08:00
|
|
|
|
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
|
1999-01-28 12:34:55 +08:00
|
|
|
int detach,
|
|
|
|
void *(*start_routine)(void *),
|
|
|
|
void *arg)
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
1999-01-28 12:34:55 +08:00
|
|
|
if( ! detach ) ldap_int_status = NULL;
|
|
|
|
start_routine( arg );
|
1999-01-15 22:54:25 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-01-28 12:34:55 +08:00
|
|
|
void
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_exit( void *retval )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
1999-01-28 12:34:55 +08:00
|
|
|
if( retval != NULL ) {
|
|
|
|
ldap_int_status = retval;
|
|
|
|
}
|
|
|
|
return;
|
1999-01-15 22:54:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **status )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
1999-01-28 12:34:55 +08:00
|
|
|
if(status != NULL) *status = ldap_int_status;
|
1999-01-15 22:54:25 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_yield( void )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-01-29 14:05:18 +08:00
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond )
|
1999-01-29 14:05:18 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-01-15 22:54:25 +08:00
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-01-29 07:40:26 +08:00
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
|
1999-01-29 07:40:26 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-01-15 22:54:25 +08:00
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
|
|
|
|
ldap_pvt_thread_mutex_t *mutex )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2000-06-08 07:58:16 +08:00
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mutex )
|
2000-06-08 07:58:16 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-01-15 22:54:25 +08:00
|
|
|
int
|
2000-06-13 10:42:13 +08:00
|
|
|
ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
|
1999-01-15 22:54:25 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2000-06-13 10:42:13 +08:00
|
|
|
/*
|
|
|
|
* NO_THREADS requires a separate tpool implementation since
|
|
|
|
* generic ldap_pvt_thread_pool_wrapper loops forever.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
ldap_pvt_thread_pool_init (
|
|
|
|
ldap_pvt_thread_pool_t *pool_out,
|
|
|
|
int max_concurrency, int max_pending )
|
|
|
|
{
|
2000-10-07 05:16:26 +08:00
|
|
|
*pool_out = (ldap_pvt_thread_pool_t) 0;
|
2000-06-13 10:42:13 +08:00
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ldap_pvt_thread_pool_submit (
|
|
|
|
ldap_pvt_thread_pool_t *pool,
|
2002-08-24 13:39:43 +08:00
|
|
|
ldap_pvt_thread_start_t *start_routine, void *arg )
|
2000-06-13 10:42:13 +08:00
|
|
|
{
|
2002-08-24 13:39:43 +08:00
|
|
|
(start_routine)(NULL, arg);
|
2000-06-13 10:42:13 +08:00
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
2000-07-06 01:36:58 +08:00
|
|
|
int
|
|
|
|
ldap_pvt_thread_pool_maxthreads ( ldap_pvt_thread_pool_t *tpool, int max_threads )
|
|
|
|
{
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
2000-06-13 10:42:13 +08:00
|
|
|
int
|
|
|
|
ldap_pvt_thread_pool_backload (
|
|
|
|
ldap_pvt_thread_pool_t *pool )
|
|
|
|
{
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ldap_pvt_thread_pool_destroy (
|
|
|
|
ldap_pvt_thread_pool_t *pool, int run_pending )
|
|
|
|
{
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
2002-08-24 13:39:43 +08:00
|
|
|
int ldap_pvt_thread_pool_getkey (
|
2002-08-27 03:26:09 +08:00
|
|
|
void *ctx, void *key, void **data, ldap_pvt_thread_pool_keyfree_t **kfree )
|
2002-08-24 13:39:43 +08:00
|
|
|
{
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int ldap_pvt_thread_pool_setkey (
|
2002-08-27 03:26:09 +08:00
|
|
|
void *ctx, void *key, void *data, ldap_pvt_thread_pool_keyfree_t *kfree )
|
2002-08-24 13:39:43 +08:00
|
|
|
{
|
|
|
|
return(0);
|
|
|
|
}
|
2003-01-24 14:49:13 +08:00
|
|
|
|
2003-04-16 08:18:56 +08:00
|
|
|
void *ldap_pvt_thread_pool_context( )
|
|
|
|
{
|
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
2003-01-24 14:49:13 +08:00
|
|
|
ldap_pvt_thread_t
|
|
|
|
ldap_pvt_thread_self( void )
|
|
|
|
{
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
1999-01-15 22:54:25 +08:00
|
|
|
#endif /* NO_THREADS */
|