<commit_before>/**
 * @file
 * @brief Multi-thread sleep
 *
 * @date 05.07.11
 * @author <NAME>
 * @author <NAME>
 */

#include <errno.h>
#include <types.h>
#include <time.h>

#include <kernel/time/timer.h>
#include <kernel/thread/sched.h>
#include <kernel/thread/event.h>

/* system library function */
int usleep(useconds_t usec) {
	int res_sleep;
	struct event never_happen;

	if (usec == 0) {
		sched_yield();
		return 0;
	}

	event_init(&never_happen, NULL);

	res_sleep = sched_sleep(&never_happen, usec);

	return res_sleep == SCHED_TIMEOUT_HAPPENED ? 0 : res_sleep;
}

int sleep(unsigned int seconds) {
	return usleep(seconds * 1000);
}
<commit_msg>Fix build after b7d5746<commit_after>/**
 * @file
 * @brief Multi-thread sleep
 *
 * @date 05.07.11
 * @author <NAME>
 * @author <NAME>
 */

#include <errno.h>
#include <types.h>
#include <time.h>

#include <kernel/time/timer.h>
#include <kernel/thread/sched.h>
#include <kernel/thread/event.h>

/* system library function */
int usleep(useconds_t usec) {
	int res_sleep;
	struct event never_happen;

	if (usec == 0) {
		sched_yield();
		return 0;
	}

	event_init(&never_happen, NULL);

	res_sleep = sched_sleep(&never_happen, usec);

	return res_sleep == SCHED_SLEEP_TIMEOUT ? 0 : res_sleep;
}

int sleep(unsigned int seconds) {
	return usleep(seconds * 1000);
}

{'fraction_non_alphanumeric': 0.1514004542013626, 'fraction_numerical': 0.023467070401211203, 'mean_word_length': 4.246031746031746, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5183524', 'n_tokens_mistral': 545, 'n_tokens_neox': 508, 'n_words': 117}