summaryrefslogtreecommitdiffhomepage
path: root/src/libPThread/PThreadKit/Thread.h
blob: 85f7a3208738f89dca2536eee69ad0be3019c2eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel

#ifndef LIBPOSIX_POSIXKIT_THREAD_H
#define LIBPOSIX_POSIXKIT_THREAD_H

#include <libPOSIXWrapper/POSIXKit/unistd.h>

#define PTHREAD_UNSAFE /* hint */
#define PTHREAD_SAFE /* hint */

PTHREAD_SAFE SInt32 pthread_create(_Output ThreadRef* thread, VoidPtr attr, VoidPtr (*start_routine)(VoidPtr), VoidPtr arg);
PTHREAD_SAFE SInt32 pthread_join(ThreadRef thread, VoidPtr* retval);
PTHREAD_SAFE SInt32 pthread_exit(SInt32 retval);
PTHREAD_SAFE SInt32 pthread_detach(ThreadRef thread);
PTHREAD_SAFE ThreadRef pthread_self(Void);
PTHREAD_SAFE SInt32 pthread_yield(void);

#endif  // LIBPOSIX_POSIXKIT_THREAD_H