MySQL Internals Manual  /  ...  /  Debug Sync Implementation

24.6.3 Debug Sync Implementation

Pseudo code for a synchronization point:

#define DEBUG_SYNC(thd, sync_point_name)
  if (unlikely(opt_debug_sync_timeout))
  debug_sync(thd, STRING_WITH_LEN(sync_point_name))

The synchronization point performs a binary search in a sorted array of actions for this thread.

The SET DEBUG_SYNC statement adds a requested action to the array or overwrites an existing action for the same synchronization point. When it adds a new action, the array is sorted again.