YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
my_bool my_service_thread_sleep(MA_SERVICE_THREAD_CONTROL *control,
ulonglong sleep_time)
{ struct timespec abstime;
my_bool res= FALSE;
DBUG_ENTER("my_service_thread_sleep");
DBUG_PRINT("init", ("control %p", control));
mysql_mutex_lock(control->LOCK_control); if (control->killed)
{
mysql_mutex_unlock(control->LOCK_control);
DBUG_RETURN(TRUE);
} #if0/* good for testing, to do a lot of checkpoints, finds a lot of bugs */
mysql_mutex_unlock(&control->LOCK_control);
my_sleep(100000); /* a tenth of a second */
mysql_mutex_lock(&control->LOCK_control); #else /* To have a killable sleep, we use timedwait like our SQL GET_LOCK() */
DBUG_PRINT("info", ("sleeping %llu nano seconds", sleep_time)); if (sleep_time)
{
set_timespec_nsec(abstime, sleep_time);
mysql_cond_timedwait(control->COND_control,
control->LOCK_control, &abstime);
} #endif if (control->killed)
res= TRUE;
mysql_mutex_unlock(control->LOCK_control);
DBUG_RETURN(res);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.8 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.