summaryrefslogtreecommitdiffhomepage
path: root/src/libPThread/PThreadKit/Thread.h
blob: 02c1a574028a9ad9522cb09a30f10c27b9d9abd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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>

/// @internal Internal type, please do not rely on it for multi-platform builds.
typedef ThreadRef pthread_ref_t;

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

#endif  // LIBPOSIX_POSIXKIT_THREAD_H