1 |
/* IPC related system calls. |
/* IPC related system calls. |
2 |
Copyright 1999, 2000, 2001 Johan Rydberg, jrydberg@opencores.org. |
Copyright 1999, 2000, 2001, 2002 Johan Rydberg, jrydberg@opencores.org. |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
332 |
|
|
333 |
else if (ipc_tqueue_empty (&port->waiting_threads) == false) |
else if (ipc_tqueue_empty (&port->waiting_threads) == false) |
334 |
{ |
{ |
335 |
bool succeeded; |
bool failed; |
336 |
SPL_T spl; |
SPL_T spl; |
337 |
|
|
338 |
/* We have to update the lock from read to write. */ |
/* We have to update the lock from read to write. */ |
339 |
|
|
340 |
succeeded = thread_lock_read_to_write (&port->lock); |
failed = thread_lock_read_to_write (&port->lock); |
341 |
assert (succeeded); |
assert (failed == false); |
342 |
|
|
343 |
/* Remove thread from wait queue. */ |
/* Remove thread from wait queue. */ |
344 |
|
|
380 |
|
|
381 |
else |
else |
382 |
{ |
{ |
383 |
bool succeeded, result; |
bool failed, result; |
384 |
|
|
385 |
/* We have to update the lock from read to write. */ |
/* We have to update the lock from read to write. */ |
386 |
|
|
387 |
succeeded = thread_lock_read_to_write (&port->lock); |
failed = thread_lock_read_to_write (&port->lock); |
388 |
assert (succeeded); |
assert (failed == false); |
389 |
|
|
390 |
enqueue_message_on_port: |
enqueue_message_on_port: |
391 |
|
|
443 |
|
|
444 |
/* Upgrade to write lock for port. */ |
/* Upgrade to write lock for port. */ |
445 |
|
|
446 |
while (! thread_lock_read_to_write (&port->lock)) |
while (thread_lock_read_to_write (&port->lock)) |
447 |
assert (0); /* ??? block? */ |
assert (0); /* ??? block? */ |
448 |
|
|
449 |
/* Remove message from port message queue and copy message into |
/* Remove message from port message queue and copy message into |