/*
 * Copyright (c) 1994, 2021 Alex Leigh, All Rights Reserved
 *
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ALEX LEIGH The copyright
 * notice above does not evidence any actual or intended publication of such
 * source code.
 *
 * Disclosure, copying, distribution, or transmission of this code without
 * express permission is prohibited.
 */

#ifndef MECHA_THR_H
#define MECHA_THR_H

#include <mecha.h>

#ifndef _WIN32

#include "thr_posix.h"

#else

#include "thr_win.h"

#endif

int mFthr_create(struct mSthr *thread, void (*func)(void *));

#ifndef _WIN32
void mFthr_free(__attribute__((unused)) struct mSthr *thread);
#else

void mFthr_free(struct mSthr *thread);

#endif

void mFthr_sleep(int ms);

int mFthr_join(struct mSthr *thread);

void mFthr_sleep(int ms);

int mFthr_mutex_init(struct mSthr_mutex *mutex);

int mFthr_mutex_unlock(struct mSthr_mutex *mutex);

int mFthr_mutex_lock(struct mSthr_mutex *mutex);

void mFthr_mutex_free(struct mSthr_mutex *mutex);

#endif //MECHA_THR_H
