9 int CALL01(___Object______hashCode____, 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(stackptr);
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 VAR(___this___)->___nextlockobject___->___prevlockobject___=VAR(___this___);
35 pthread_setspecific(threadlocks, VAR(___this___));
36 VAR(___this___)->lockcount=1;
37 VAR(___this___)->tid=self;
38 pthread_mutex_unlock(&objlock);
43 struct listitem *tmp=stopforgc(stackptr);
45 pthread_cond_wait(&objcond, &objlock);
54 int CALL01(___Object______MonitorExit____, struct ___Object___ * ___this___) {
55 pthread_t self=pthread_self();
56 if (self==VAR(___this___)->tid) {
57 VAR(___this___)->lockcount--;
58 if (VAR(___this___)->lockcount==0) {
59 if (VAR(___this___)->___prevlockobject___==NULL) {
60 pthread_setspecific(threadlocks, VAR(___this___)->___nextlockobject___);
62 VAR(___this___)->___prevlockobject___->___nextlockobject___=VAR(___this___)->___nextlockobject___;
63 if (VAR(___this___)->___nextlockobject___!=NULL)
64 VAR(___this___)->___nextlockobject___->___prevlockobject___=VAR(___this___)->___prevlockobject___;
65 VAR(___this___)->lockentry=NULL;
66 VAR(___this___)->tid=0;
68 pthread_mutex_lock(&objlock);
69 pthread_cond_broadcast(&objcond);
70 pthread_mutex_unlock(&objlock);
72 printf("ERROR...UNLOCKING LOCK WE DON'T HAVE\n");