Welcome to mirror list, hosted at ThFree Co, Russian Federation.

timed-thread.h « io-layer « mono - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 82c9d6c307e3365dd7251365b320c1de1115f740 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * timed-thread.h:  Implementation of timed thread joining
 *
 * Author:
 *	Dick Porter (dick@ximian.com)
 *
 * (C) 2002 Ximian, Inc.
 */

#ifndef _WAPI_TIMED_THREAD_H_
#define _WAPI_TIMED_THREAD_H_

#include <config.h>
#include <glib.h>
#include <pthread.h>

#include "mono-mutex.h"

typedef struct
{
	pthread_t id;
	mono_mutex_t join_mutex;
	pthread_cond_t exit_cond;
	guint32 (*start_routine)(gpointer arg);
	void (*exit_routine)(guint32 exitstatus, gpointer userdata);
	gpointer arg;
	gpointer exit_userdata;
	guint32 exitstatus;
	gboolean exiting;
} TimedThread;

extern void _wapi_timed_thread_exit(guint32 exitstatus) G_GNUC_NORETURN;
extern int _wapi_timed_thread_create(TimedThread **threadp,
				     const pthread_attr_t *attr,
				     guint32 (*start_routine)(gpointer),
				     void (*exit_routine)(guint32, gpointer),
				     gpointer arg, gpointer exit_userdata);
extern int _wapi_timed_thread_join(TimedThread *thread,
				   struct timespec *timeout,
				   guint32 *exitstatus);
extern void _wapi_timed_thread_destroy (TimedThread *thread);

#endif /* _WAPI_TIMED_THREAD_H_ */