| 674 | |
| 675 | |
| 676 | SLONG SharedMemoryBase::eventClear(event_t* event) |
| 677 | { |
| 678 | /************************************** |
| 679 | * |
| 680 | * I S C _ e v e n t _ c l e a r |
| 681 | * |
| 682 | ************************************** |
| 683 | * |
| 684 | * Functional description |
| 685 | * Clear an event preparatory to waiting on it. The order of |
| 686 | * battle for event synchronization is: |
| 687 | * |
| 688 | * 1. Clear event. |
| 689 | * 2. Test data structure for event already completed |
| 690 | * 3. Wait on event. |
| 691 | * |
| 692 | **************************************/ |
| 693 | |
| 694 | fb_assert(event->event_pid == getpid()); |
| 695 | |
| 696 | #if defined(WIN_NT) |
| 697 | |
| 698 | ResetEvent(event->event_handle); |
| 699 | |
| 700 | return event->event_count + 1; |
| 701 | |
| 702 | #else // pthread-based event |
| 703 | |
| 704 | LOG_PTHREAD_ERROR(pthread_mutex_lock(event->event_mutex)); |
| 705 | const SLONG ret = event->event_count + 1; |
| 706 | LOG_PTHREAD_ERROR(pthread_mutex_unlock(event->event_mutex)); |
| 707 | return ret; |
| 708 | |
| 709 | #endif // OS-dependent choice |
| 710 | |
| 711 | } |
| 712 | |
| 713 | |
| 714 | int SharedMemoryBase::eventWait(event_t* event, const SLONG value, const SLONG micro_seconds) |
no test coverage detected