]>
Commit | Line | Data |
---|---|---|
4710c53d | 1 | \r |
2 | /*\r | |
3 | * Initialization.\r | |
4 | */\r | |
5 | static void\r | |
6 | PyThread__init_thread(void)\r | |
7 | {\r | |
8 | }\r | |
9 | \r | |
10 | /*\r | |
11 | * Thread support.\r | |
12 | */\r | |
13 | long\r | |
14 | PyThread_start_new_thread(void (*func)(void *), void *arg)\r | |
15 | {\r | |
16 | int success = 0; /* init not needed when SOLARIS_THREADS and */\r | |
17 | /* C_THREADS implemented properly */\r | |
18 | \r | |
19 | dprintf(("PyThread_start_new_thread called\n"));\r | |
20 | if (!initialized)\r | |
21 | PyThread_init_thread();\r | |
22 | return success < 0 ? -1 : 0;\r | |
23 | }\r | |
24 | \r | |
25 | long\r | |
26 | PyThread_get_thread_ident(void)\r | |
27 | {\r | |
28 | if (!initialized)\r | |
29 | PyThread_init_thread();\r | |
30 | }\r | |
31 | \r | |
32 | void\r | |
33 | PyThread_exit_thread(void)\r | |
34 | {\r | |
35 | dprintf(("PyThread_exit_thread called\n"));\r | |
36 | if (!initialized)\r | |
37 | exit(0);\r | |
38 | }\r | |
39 | \r | |
40 | /*\r | |
41 | * Lock support.\r | |
42 | */\r | |
43 | PyThread_type_lock\r | |
44 | PyThread_allocate_lock(void)\r | |
45 | {\r | |
46 | \r | |
47 | dprintf(("PyThread_allocate_lock called\n"));\r | |
48 | if (!initialized)\r | |
49 | PyThread_init_thread();\r | |
50 | \r | |
51 | dprintf(("PyThread_allocate_lock() -> %p\n", lock));\r | |
52 | return (PyThread_type_lock) lock;\r | |
53 | }\r | |
54 | \r | |
55 | void\r | |
56 | PyThread_free_lock(PyThread_type_lock lock)\r | |
57 | {\r | |
58 | dprintf(("PyThread_free_lock(%p) called\n", lock));\r | |
59 | }\r | |
60 | \r | |
61 | int\r | |
62 | PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)\r | |
63 | {\r | |
64 | int success;\r | |
65 | \r | |
66 | dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));\r | |
67 | dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));\r | |
68 | return success;\r | |
69 | }\r | |
70 | \r | |
71 | void\r | |
72 | PyThread_release_lock(PyThread_type_lock lock)\r | |
73 | {\r | |
74 | dprintf(("PyThread_release_lock(%p) called\n", lock));\r | |
75 | }\r |