| 409 | } |
| 410 | |
| 411 | void LightSemaphore_Release(LightSemaphore* semaphore, s32 count) |
| 412 | { |
| 413 | __dmb(); |
| 414 | |
| 415 | s32 old_count, new_count; |
| 416 | do |
| 417 | { |
| 418 | old_count = __ldrex(&semaphore->current_count); |
| 419 | new_count = old_count + count; |
| 420 | if (new_count >= semaphore->max_count) |
| 421 | new_count = semaphore->max_count; |
| 422 | } while (__strex(&semaphore->current_count, new_count)); |
| 423 | |
| 424 | if(old_count <= 0 || semaphore->num_threads_acq > 0) |
| 425 | syncArbitrateAddress(&semaphore->current_count, ARBITRATION_SIGNAL, count); |
| 426 | } |
nothing calls this directly
no test coverage detected