thread_foobar.h 1.39 KB
Newer Older
1 2 3 4

/*
 * Initialization.
 */
5 6
static void
PyThread__init_thread(void)
7 8 9 10 11 12
{
}

/*
 * Thread support.
 */
13
long
14
PyThread_start_new_thread(void (*func)(void *), void *arg)
15
{
16 17
    int success = 0;            /* init not needed when SOLARIS_THREADS and */
                /* C_THREADS implemented properly */
18

19 20 21 22
    dprintf(("PyThread_start_new_thread called\n"));
    if (!initialized)
        PyThread_init_thread();
    return success < 0 ? -1 : 0;
23 24
}

25 26
long
PyThread_get_thread_ident(void)
27
{
28 29
    if (!initialized)
        PyThread_init_thread();
30 31
}

32 33
void
PyThread_exit_thread(void)
34
{
35 36 37
    dprintf(("PyThread_exit_thread called\n"));
    if (!initialized)
        exit(0);
38 39 40 41 42
}

/*
 * Lock support.
 */
43 44
PyThread_type_lock
PyThread_allocate_lock(void)
45 46
{

47 48 49
    dprintf(("PyThread_allocate_lock called\n"));
    if (!initialized)
        PyThread_init_thread();
50

51 52
    dprintf(("PyThread_allocate_lock() -> %p\n", lock));
    return (PyThread_type_lock) lock;
53 54
}

55 56
void
PyThread_free_lock(PyThread_type_lock lock)
57
{
58
    dprintf(("PyThread_free_lock(%p) called\n", lock));
59 60
}

61 62
int
PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
63
{
64
    int success;
65

66 67 68
    dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
    dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
    return success;
69 70
}

71 72
void
PyThread_release_lock(PyThread_type_lock lock)
73
{
74
    dprintf(("PyThread_release_lock(%p) called\n", lock));
75
}