With the current implementation, ompt_thread_info.wait_id is set to 0 once the thread got the lock. This value is used to provide the lock id for the event calls.
With this patch, the lock id as provided by the function argument is used. Now all event callbacks provide a consistent lock id.