Urgh...
Variable reuse, Victor, variable reuse.
<Victor hits head on desk, noting that he was obviously on vacation.>
> int Acquire_Condition_Lock(struct Condition *c) {
> int thrid = thread_id_of(current_thread);
> if (c->thread_id == thrid) exit(1); /* Deadlock */
> acquire(*(c->lock));
> acquire(c->condlock);
> c->thread_id = thread_id_of(current_thread);
> release(c->condlock);
> return 0;
> }
>
Make that:
int Acquire_Condition_Lock(struct Condition *c) {
int thrid = thread_id_of(current_thread);
if (c->thread_id == thrid) exit(1); /* Deadlock */
acquire(*(c->lock));
acquire(c->condlock);
c->thread_id = thrid;
release(c->condlock);
return 0;
}
Victor
--
Victor J. Orlikowski | The Wall is Down, But the Threat Remains!
==================================================================
[EMAIL PROTECTED] | [EMAIL PROTECTED] | [EMAIL PROTECTED]