9 int CALL01(___Object______nativehashCode____, struct ___Object___ * ___this___) {
10 return (int) VAR(___this___);
13 int CALL01(___Object______getType____, struct ___Object___ * ___this___) {
14 return ((int *)VAR(___this___))[0];
18 int CALL01(___Object______MonitorEnter____, struct ___Object___ * ___this___) {
19 pthread_t self=pthread_self();
20 if (self==VAR(___this___)->tid) {
21 VAR(___this___)->lockcount++;
24 struct listitem *tmp=stopforgc((struct garbagelist *)___params___);
26 pthread_mutex_lock(&objlock);
31 if (VAR(___this___)->tid==0) {
32 VAR(___this___)->___prevlockobject___=NULL;
33 VAR(___this___)->___nextlockobject___=(struct ___Object___ *)pthread_getspecific(threadlocks);
34 if (VAR(___this___)->___nextlockobject___!=NULL)
35 VAR(___this___)->___nextlockobject___->___prevlockobject___=VAR(___this___);
36 pthread_setspecific(threadlocks, VAR(___this___));
37 VAR(___this___)->lockcount=1;
38 VAR(___this___)->tid=self;
39 pthread_mutex_unlock(&objlock);
44 struct listitem *tmp=stopforgc((struct garbagelist *)___params___);
46 pthread_cond_wait(&objcond, &objlock);
55 int CALL01(___Object______MonitorExit____, struct ___Object___ * ___this___) {
56 pthread_t self=pthread_self();
57 if (self==VAR(___this___)->tid) {
58 VAR(___this___)->lockcount--;
59 if (VAR(___this___)->lockcount==0) {
60 if (VAR(___this___)->___prevlockobject___==NULL) {
61 pthread_setspecific(threadlocks, VAR(___this___)->___nextlockobject___);
63 VAR(___this___)->___prevlockobject___->___nextlockobject___=VAR(___this___)->___nextlockobject___;
64 if (VAR(___this___)->___nextlockobject___!=NULL)
65 VAR(___this___)->___nextlockobject___->___prevlockobject___=VAR(___this___)->___prevlockobject___;
66 VAR(___this___)->lockentry=NULL;
67 VAR(___this___)->tid=0;
69 pthread_mutex_lock(&objlock);
70 pthread_cond_broadcast(&objcond);
71 pthread_mutex_unlock(&objlock);
73 printf("ERROR...UNLOCKING LOCK WE DON'T HAVE\n");