First draft of thread abstraction.
This commit is contained in:
39
src/thread.h
Normal file
39
src/thread.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/* thread.h
|
||||
** XMPP client library -- thread abstraction header
|
||||
**
|
||||
** Copyright (C) 2005 Online Game Group. All rights reserved.
|
||||
**
|
||||
** This software is provided AS-IS with no warranty, either express
|
||||
** or implied.
|
||||
**
|
||||
** This software is distributed under license and may not be copied,
|
||||
** modified or distributed except as expressly authorized under the
|
||||
** terms of the license contained in the file LICENSE.txt in this
|
||||
** distribution.
|
||||
*/
|
||||
|
||||
#ifndef __LIBSTROPHE_THREAD_H__
|
||||
#define __LIBSTROPHE_THREAD_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#include "strophe.h"
|
||||
|
||||
typedef struct _mutex_t mutex_t;
|
||||
|
||||
/* mutex functions */
|
||||
|
||||
mutex_t *mutex_create(const xmpp_ctx_t *ctx);
|
||||
int mutex_destroy(mutex_t *mutex);
|
||||
int mutex_lock(mutex_t *mutex);
|
||||
int mutex_trylock(mutex_t *mutex);
|
||||
int mutex_unlock(mutex_t *mutex);
|
||||
|
||||
#endif /* __LIBSTROPHE_THREAD_H__ */
|
||||
Reference in New Issue
Block a user