obsolete/locks.c
int __remove_lock( JIMP_obj obj, JIMP_thread_s *own_thread ) {

	JIMP_lock *l, *p, *n;
	int  do_not_mutexes;
	
	/* Try to find lock */
	p = (JIMP_lock *)&(own_thread->lock);
	l = p->next;

	while( l ){
	  if( l->obj_ref == obj ) {  
	  
	  	do_not_mutexes = 0;
	    if( l->n_times_locked < 0 ) do_not_mutexes = 1;
		
	  	l->n_times_locked--; 
		if( l->n_times_locked <= 0 ){
		  n = l->next;
		  p->next = n;
		  free( l );  
		/* Nobody own of its lock */
		  heap[ obj ].vm_t->towner = 0;
		  heap[ obj ].vm_t->towner_obj = 0;
		  return do_not_mutexes;
		}
		return do_not_mutexes; 
	  }
	  p = p->next;
	  l = l->next;
	}
	
	return 0; 
}
/* Remove lock reference from the thread's locks list */
Remove lock reference from the thread's locks list
Remove lock reference from the thread ' s locks list
int __remove_lock( JIMP_obj obj, JIMP_thread_s *own_thread ) {
	JIMP_lock *l, *p, *n;
	int  do_not_mutexes;
	p = (JIMP_lock *)&(own_thread->lock);
	l = p->next;
	while( l ){
	  if( l->obj_ref == obj ) {  
	  	do_not_mutexes = 0;
	    if( l->n_times_locked < 0 ) do_not_mutexes = 1;
	  	l->n_times_locked--; 
		if( l->n_times_locked <= 0 ){
		  n = l->next;
		  p->next = n;
		  free( l );  
		  heap[ obj ].vm_t->towner = 0;
		  heap[ obj ].vm_t->towner_obj = 0;
		  return do_not_mutexes;
		}
		return do_not_mutexes; 
	  }
	  p = p->next;
	  l = l->next;
	}
	return 0; 
}
int __remove_lock ( JIMP_obj obj , JIMP_thread_s * own_thread ) { JIMP_lock * l , * p , * n ; int do_not_mutexes ; p = ( JIMP_lock * ) & ( own_thread -> lock ) ; l = p -> next ; while ( l ) { if ( l -> obj_ref == obj ) { do_not_mutexes = 0 ; if ( l -> n_times_locked < 0 ) do_not_mutexes = 1 ; l -> n_times_locked -- ; if ( l -> n_times_locked <= 0 ) { n = l -> next ; p -> next = n ; free ( l ) ; heap [ obj ] . vm_t -> towner = 0 ; heap [ obj ] . vm_t -> towner_obj = 0 ; return do_not_mutexes ; } return do_not_mutexes ; } p = p -> next ; l = l -> next ; } return 0 ; }
Remove lock reference from the thread's locks list
Remove lock reference from the thread ' s locks list
/* Try to find lock */ /* Nobody own of its lock */