pike.git/
src/
threads.c
Branch:
Tag:
Non-build tags
All tags
No tags
2001-09-25
2001-09-25 14:07:05 by Henrik Grubbström (Grubba) <grubba@grubba.org>
b8efe04953b1d04de5196faea0966ea48e18631e (
10
lines) (+
9
/-
1
)
[
Show
|
Annotate
]
Branch:
7.2
Added Thread.Thread->id_number().
Rev: src/threads.c:1.158
1:
#include "global.h"
-
RCSID("$Id: threads.c,v 1.
157
2001/09/
07
21
:
20
:
18
hubbe
Exp $");
+
RCSID("$Id: threads.c,v 1.
158
2001/09/
25
14
:
05
:
09
grubba
Exp $");
PMOD_EXPORT int num_threads = 1; PMOD_EXPORT int threads_disabled = 0;
1066:
f_add (3); }
+
void f_thread_id_id_number(INT32 args)
+
{
+
pop_n_elems(args);
+
push_int64((ptrdiff_t)THIS_THREAD->id);
+
}
+
static void f_thread_id_result(INT32 args) { struct thread_state *th=THIS_THREAD;
1445:
/* function(:int) */ ADD_FUNCTION("status",f_thread_id_status,tFunc(tNone,tInt),0); ADD_FUNCTION("_sprintf",f_thread_id__sprintf,tFunc(tNone,tStr),0);
+
ADD_FUNCTION("id_number",f_thread_id_id_number,tFunc(tNone,tInt),0);
set_gc_recurse_callback(thread_was_recursed); set_gc_check_callback(thread_was_checked); set_init_callback(init_thread_obj);