Document Empire's thread abstraction. Minor cleanups:

(empth_init): Change first parameter to void **.
(empth_sleep): Change parameter to time_t.
This commit is contained in:
Markus Armbruster 2005-06-25 16:37:59 +00:00
parent 89087bef17
commit 060df4ec8f
5 changed files with 132 additions and 20 deletions

View file

@ -38,9 +38,9 @@
#ifdef _EMPTH_LWP
int
empth_init(char **ctx, int flags)
empth_init(void **ctx, int flags)
{
lwpInitSystem(7, ctx, flags);
lwpInitSystem(7, (char **)ctx, flags);
return 0;
}
@ -113,7 +113,7 @@ empth_wakeup(empth_t *a)
}
void
empth_sleep(long int until)
empth_sleep(time_t until)
{
lwpSleepUntil(until);
}

View file

@ -139,7 +139,7 @@ static struct {
/* Pointer out to global context. "player". */
/* From empth_init parameter. */
char **ppvUserData;
void **ppvUserData;
/* Global flags. From empth_init parameter. */
int flags;
@ -379,7 +379,7 @@ empth_threadMain(void *pvData)
* This is called from the program main line.
*/
int
empth_init(char **ctx_ptr, int flags)
empth_init(void **ctx_ptr, int flags)
{
loc_Thread_t *pThread = NULL;
@ -640,7 +640,7 @@ empth_wakeup(empth_t *a)
* Put the given thread to sleep...
*/
void
empth_sleep(long until)
empth_sleep(time_t until)
{
loc_Thread_t *pThread =
(loc_Thread_t *)TlsGetValue(loc_GVAR.dwTLSIndex);

View file

@ -52,7 +52,7 @@
#ifdef _EMPTH_POSIX
static pthread_key_t ctx_key;
static int empth_flags;
static char **udata; /* pointer to out global context */
static void **udata; /* pointer to out global context */
static pthread_mutex_t mtx_ctxsw; /* thread in critical section */
@ -121,7 +121,7 @@ empth_status(char *format, ...)
int
empth_init(char **ctx_ptr, int flags)
empth_init(void **ctx_ptr, int flags)
{
empth_t *ctx;
struct sigaction act;
@ -425,7 +425,7 @@ empth_wakeup(empth_t *a)
}
void
empth_sleep(long until)
empth_sleep(time_t until)
{
struct timeval tv;