pike.git/
src/
threads.c
Branch:
Tag:
Non-build tags
All tags
No tags
2000-03-30
2000-03-30 04:39:17 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
56ac10f4aa85ef4c41f5fd3839c90b71087fe953 (
10
lines) (+
9
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
some DMALLOC (in)sanity
Rev: src/main.c:1.85
Rev: src/threads.c:1.116
Rev: src/threads.h:1.78
1:
#include "global.h"
-
RCSID("$Id: threads.c,v 1.
115
2000/03/
25
20
:
58
:
30
hubbe Exp $");
+
RCSID("$Id: threads.c,v 1.
116
2000/03/
30
04
:
39
:
17
hubbe Exp $");
int num_threads = 1; int threads_disabled = 0;
378:
#define THREAD_TABLE_SIZE 127 /* Totally arbitrary prime */ static struct thread_state *thread_table_chains[THREAD_TABLE_SIZE];
+
static int num_pike_threads=0;
void thread_table_init(void) {
421:
/* dumpmem("thread_table_insert",&s->id, sizeof(THREAD_T)); */ #endif mt_lock( & thread_table_lock );
+
num_pike_threads++;
if((s->hashlink = thread_table_chains[h]) != NULL) s->hashlink->backlink = &s->hashlink; thread_table_chains[h] = s;
433:
struct thread_state *s = OBJ2THREAD(o); /* dumpmem("thread_table_delete",&s->id, sizeof(THREAD_T)); */ mt_lock( & thread_table_lock );
+
num_pike_threads--;
if(s->hashlink != NULL) s->hashlink->backlink = s->backlink; *(s->backlink) = s->hashlink;
519:
f_aggregate(sp-oldsp); }
+
int count_pike_threads(void)
+
{
+
return num_pike_threads;
+
}
static void check_threads(struct callback *cb, void *arg, void * arg2) {