PSP2SDK  dirty-f9e4f2d
The free SDK for PSP2
Data Structures | Typedefs | Enumerations | Functions
include/psp2/kernel/threadmgr.h File Reference

Header file related to thread management. More...

#include <psp2/types.h>
Include dependency graph for threadmgr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SceKernelThreadOptParam
struct  SceKernelThreadInfo
struct  SceKernelThreadRunStatus
struct  SceKernelSemaOptParam
struct  SceKernelSemaInfo
struct  SceKernelMutexOptParam
struct  SceKernelMutexInfo
struct  SceKernelEventFlagInfo
struct  SceKernelEventFlagOptParam
struct  SceKernelCallbackInfo
struct  SceKernelMppInfo
struct  SceKernelSystemInfo

Typedefs

typedef SceUInt64 SceKernelSysClock
typedef int(* SceKernelThreadEntry )(SceSize args, void *argp)
typedef struct
SceKernelThreadOptParam 
SceKernelThreadOptParam
typedef struct SceKernelThreadInfo SceKernelThreadInfo
typedef struct
SceKernelThreadRunStatus 
SceKernelThreadRunStatus
typedef enum Psp2ThreadStatus Psp2ThreadStatus
typedef struct
SceKernelSemaOptParam 
SceKernelSemaOptParam
typedef struct SceKernelSemaInfo SceKernelSemaInfo
typedef struct
SceKernelMutexOptParam 
SceKernelMutexOptParam
typedef struct SceKernelMutexInfo SceKernelMutexInfo
typedef struct
SceKernelEventFlagInfo 
SceKernelEventFlagInfo
typedef struct
SceKernelEventFlagOptParam 
SceKernelEventFlagOptParam
typedef enum
Psp2EventFlagAttributes 
Psp2EventFlagAttributes
typedef enum Psp2EventFlagWaitTypes Psp2EventFlagWaitTypes
typedef int(* SceKernelCallbackFunction )(int notifyId, int notifyCount, int notifyArg, void *common)
typedef struct
SceKernelCallbackInfo 
SceKernelCallbackInfo
typedef struct SceKernelMppInfo SceKernelMppInfo
typedef struct SceKernelSystemInfo SceKernelSystemInfo
typedef enum SceKernelIdListType SceKernelIdListType

Enumerations

enum  Psp2ThreadStatus {
  PSP2_THREAD_RUNNING = 1, PSP2_THREAD_READY = 2, PSP2_THREAD_WAITING = 4, PSP2_THREAD_SUSPEND = 8,
  PSP2_THREAD_STOPPED = 16, PSP2_THREAD_KILLED = 32
}
enum  Psp2EventFlagAttributes { PSP2_EVENT_WAITMULTIPLE = 0x200 }
enum  Psp2EventFlagWaitTypes { PSP2_EVENT_WAITAND = 0, PSP2_EVENT_WAITOR = 1, PSP2_EVENT_WAITCLEAR = 0x20 }
enum  SceKernelIdListType {
  SCE_KERNEL_TMID_Thread = 1, SCE_KERNEL_TMID_Semaphore = 2, SCE_KERNEL_TMID_EventFlag = 3, SCE_KERNEL_TMID_Mbox = 4,
  SCE_KERNEL_TMID_Vpl = 5, SCE_KERNEL_TMID_Fpl = 6, SCE_KERNEL_TMID_Mpipe = 7, SCE_KERNEL_TMID_Callback = 8,
  SCE_KERNEL_TMID_ThreadEventHandler = 9, SCE_KERNEL_TMID_Alarm = 10, SCE_KERNEL_TMID_VTimer = 11, SCE_KERNEL_TMID_SleepThread = 64,
  SCE_KERNEL_TMID_DelayThread = 65, SCE_KERNEL_TMID_SuspendThread = 66, SCE_KERNEL_TMID_DormantThread = 67
}

Functions

SceUID sceKernelCreateThread (const char *name, SceKernelThreadEntry entry, int initPriority, int stackSize, SceUInt attr, int cpuAffinityMask, const SceKernelThreadOptParam *option)
int sceKernelDeleteThread (SceUID thid)
int sceKernelStartThread (SceUID thid, SceSize arglen, void *argp)
int sceKernelExitThread (int status)
int sceKernelExitDeleteThread (int status)
int sceKernelWaitThreadEnd (SceUID thid, int *stat, SceUInt *timeout)
int sceKernelWaitThreadEndCB (SceUID thid, int *stat, SceUInt *timeout)
int sceKernelDelayThread (SceUInt delay)
int sceKernelDelayThreadCB (SceUInt delay)
int sceKernelChangeCurrentThreadAttr (int unknown, SceUInt attr)
int sceKernelChangeThreadPriority (SceUID thid, int priority)
int sceKernelRotateThreadReadyQueue (int priority)
int sceKernelReleaseWaitThread (SceUID thid)
int sceKernelGetThreadId (void)
int sceKernelGetThreadCurrentPriority (void)
int sceKernelGetThreadExitStatus (SceUID thid)
int sceKernelCheckThreadStack (void)
int sceKernelGetThreadStackFreeSize (SceUID thid)
int sceKernelGetThreadInfo (SceUID thid, SceKernelThreadInfo *info)
int sceKernelGetThreadRunStatus (SceUID thid, SceKernelThreadRunStatus *status)
SceUID sceKernelCreateSema (const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option)
int sceKernelDeleteSema (SceUID semaid)
int sceKernelSignalSema (SceUID semaid, int signal)
int sceKernelWaitSema (SceUID semaid, int signal, SceUInt *timeout)
int sceKernelWaitSemaCB (SceUID semaid, int signal, SceUInt *timeout)
int sceKernelPollSema (SceUID semaid, int signal)
int sceKernelCancelSema (SceUID semaid, int setCount, int *numWaitThreads)
int sceKernelGetSemaInfo (SceUID semaid, SceKernelSemaInfo *info)
SceUID sceKernelCreateMutex (const char *name, SceUInt attr, int initCount, SceKernelMutexOptParam *option)
int sceKernelDeleteMutex (SceUID mutexid)
int sceKernelOpenMutex (const char *name)
int sceKernelCloseMutex (SceUID mutexid)
int sceKernelLockMutex (SceUID mutexid, int lockCount, unsigned int *timeout)
int sceKernelLockMutexCB (SceUID mutexid, int lockCount, unsigned int *timeout)
int sceKernelTryLockMutex (SceUID mutexid, int lockCount)
int sceKernelUnlockMutex (SceUID mutexid, int unlockCount)
int sceKernelCancelMutex (SceUID mutexid, int newCount, int *numWaitThreads)
int sceKernelGetMutexInfo (SceUID mutexid, SceKernelMutexInfo info)
SceUID sceKernelCreateEventFlag (const char *name, int attr, int bits, SceKernelEventFlagOptParam *opt)
int sceKernelSetEventFlag (SceUID evid, unsigned int bits)
int sceKernelClearEventFlag (SceUID evid, unsigned int bits)
int sceKernelPollEventFlag (int evid, unsigned int bits, unsigned int wait, unsigned int *outBits)
int sceKernelWaitEventFlag (int evid, unsigned int bits, unsigned int wait, unsigned int *outBits, SceUInt *timeout)
int sceKernelWaitEventFlagCB (int evid, unsigned int bits, unsigned int wait, unsigned int *outBits, SceUInt *timeout)
int sceKernelDeleteEventFlag (int evid)
int sceKernelGetEventFlagInfo (SceUID event, SceKernelEventFlagInfo *info)
int sceKernelCreateCallback (const char *name, unsigned int attr, SceKernelCallbackFunction func, void *arg)
int sceKernelGetCallbackInfo (SceUID cb, SceKernelCallbackInfo *infop)
int sceKernelDeleteCallback (SceUID cb)
int sceKernelNotifyCallback (SceUID cb, int arg2)
int sceKernelCancelCallback (SceUID cb)
int sceKernelGetCallbackCount (SceUID cb)
int sceKernelCheckCallback (void)
SceUID sceKernelCreateMsgPipe (const char *name, int part, int attr, void *unk1, void *opt)
int sceKernelDeleteMsgPipe (SceUID uid)
int sceKernelSendMsgPipe (SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout)
int sceKernelSendMsgPipeCB (SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout)
int sceKernelTrySendMsgPipe (SceUID uid, void *message, unsigned int size, int unk1, void *unk2)
int sceKernelReceiveMsgPipe (SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout)
int sceKernelReceiveMsgPipeCB (SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout)
int sceKernelTryReceiveMsgPipe (SceUID uid, void *message, unsigned int size, int unk1, void *unk2)
int sceKernelCancelMsgPipe (SceUID uid, int *psend, int *precv)
int sceKernelGetMsgPipeInfo (SceUID uid, SceKernelMppInfo *info)
int sceKernelGetSystemInfo (SceKernelSystemInfo *info)
SceKernelIdListType sceKernelGetThreadmgrUIDClass (SceUID uid)

Detailed Description

Header file related to thread management.

Copyright (C) 2015 PSP2SDK Project

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


Typedef Documentation

Event flag creation attributes

Event flag wait types

typedef int(* SceKernelCallbackFunction)(int notifyId, int notifyCount, int notifyArg, void *common)

Callback function prototype

Structure to hold the status information for a callback

Structure to hold the event flag information

Threadmgr types

Message Pipe status info

Current state of a mutex.

See also:
sceKernelGetMutexInfo.

Additional options used when creating mutexes.

Current state of a semaphore.

See also:
sceKernelGetSemaInfo.

Additional options used when creating semaphores.

typedef SceUInt64 SceKernelSysClock

64-bit system clock type.

Structure to hold the status information for a thread

See also:
sceKernelGetThreadInfo

Additional options used when creating threads.

Statistics about a running thread.

See also:
sceKernelGetThreadRunStatus.

Enumeration Type Documentation

Event flag creation attributes

Enumerator:
PSP2_EVENT_WAITMULTIPLE 

Allow the event flag to be waited upon by multiple threads

Event flag wait types

Enumerator:
PSP2_EVENT_WAITAND 

Wait for all bits in the pattern to be set

PSP2_EVENT_WAITOR 

Wait for one or more bits in the pattern to be set

PSP2_EVENT_WAITCLEAR 

Clear the wait pattern when it matches

Threadmgr types


Function Documentation

Cancel a callback ?

Parameters:
cb- The UID of the specified callback
Returns:
0 on succes, < 0 on error
int sceKernelCancelMsgPipe ( SceUID  uid,
int *  psend,
int *  precv 
)

Cancel a message pipe

Parameters:
uid- UID of the pipe to cancel
psend- Receive number of sending threads?
precv- Receive number of receiving threads?
Returns:
0 on success, < 0 on error
int sceKernelCancelMutex ( SceUID  mutexid,
int  newCount,
int *  numWaitThreads 
)

Cancels a mutex

Parameters:
mutexid- The mutex id returned from sceKernelCreateMutex
newCount- The new lock count of the mutex
numWaitThreads- Number of threads waiting for the mutex
Returns:
< 0 On error.
int sceKernelCancelSema ( SceUID  semaid,
int  setCount,
int *  numWaitThreads 
)

Cancels a semaphore

Parameters:
semaid- The sema id returned from sceKernelCreateSema
setCount- The new lock count of the semaphore
numWaitThreads- Number of threads waiting for the semaphore
Returns:
< 0 On error.
int sceKernelChangeCurrentThreadAttr ( int  unknown,
SceUInt  attr 
)

Modify the attributes of the current thread.

Parameters:
unknown- Set to 0.
attr- The thread attributes to modify. One of ::Psp2ThreadAttributes.
Returns:
< 0 on error.
int sceKernelChangeThreadPriority ( SceUID  thid,
int  priority 
)

Change the threads current priority.

Parameters:
thid- The ID of the thread (from sceKernelCreateThread or sceKernelGetThreadId)
priority- The new priority (the lower the number the higher the priority)
Example:
 int thid = sceKernelGetThreadId();
 // Change priority of current thread to 16
 sceKernelChangeThreadPriority(thid, 16);
Returns:
0 if successful, otherwise the error code.
int sceKernelCheckCallback ( void  )

Check callback ?

Returns:
Something or another
int sceKernelCheckThreadStack ( void  )

Check the thread stack?

Returns:
Unknown.
int sceKernelClearEventFlag ( SceUID  evid,
unsigned int  bits 
)

Clear a event flag bit pattern

Parameters:
evid- The event id returned by sceKernelCreateEventFlag
bits- The bits to clean
Returns:
< 0 on Error
int sceKernelCloseMutex ( SceUID  mutexid)

Close a mutex

Parameters:
mutexid- The mutex id returned from sceKernelCreateMutex
Returns:
Returns the value 0 if its succesful otherwise -1
int sceKernelCreateCallback ( const char *  name,
unsigned int  attr,
SceKernelCallbackFunction  func,
void *  arg 
)

Create callback

Example:
 int cbid;
 cbid = sceKernelCreateCallback("Exit Callback", exit_cb, NULL);
Parameters:
name- A textual name for the callback
func- A pointer to a function that will be called as the callback
arg- Argument for the callback ?
Returns:
>= 0 A callback id which can be used in subsequent functions, < 0 an error.
SceUID sceKernelCreateEventFlag ( const char *  name,
int  attr,
int  bits,
SceKernelEventFlagOptParam opt 
)

Create an event flag.

Parameters:
name- The name of the event flag.
attr- Attributes from Psp2EventFlagAttributes
bits- Initial bit pattern.
opt- Options, set to NULL
Returns:
< 0 on error. >= 0 event flag id.
Example:
 int evid;
 evid = sceKernelCreateEventFlag("wait_event", 0, 0, 0);
SceUID sceKernelCreateMsgPipe ( const char *  name,
int  part,
int  attr,
void *  unk1,
void *  opt 
)

Create a message pipe

Parameters:
name- Name of the pipe
part- ID of the memory partition
attr- Set to 0?
unk1- Unknown
opt- Message pipe options (set to NULL)
Returns:
The UID of the created pipe, < 0 on error
SceUID sceKernelCreateMutex ( const char *  name,
SceUInt  attr,
int  initCount,
SceKernelMutexOptParam option 
)

Creates a new mutex

Example:
 int mutexid;
 mutexid = sceKernelCreateMutex("MyMutex", 0, 1, 1, 0);
Parameters:
name- Specifies the name of the mutex
attr- Mutex attribute flags (normally set to 0)
initCount- Mutex initial value
option- Mutex options (normally set to 0)
Returns:
A mutex id
SceUID sceKernelCreateSema ( const char *  name,
SceUInt  attr,
int  initVal,
int  maxVal,
SceKernelSemaOptParam option 
)

Creates a new semaphore

Example:
 int semaid;
 semaid = sceKernelCreateSema("MyMutex", 0, 1, 1, 0);
Parameters:
name- Specifies the name of the sema
attr- Sema attribute flags (normally set to 0)
initVal- Sema initial value
maxVal- Sema maximum value
option- Sema options (normally set to 0)
Returns:
A semaphore id
SceUID sceKernelCreateThread ( const char *  name,
SceKernelThreadEntry  entry,
int  initPriority,
int  stackSize,
SceUInt  attr,
int  cpuAffinityMask,
const SceKernelThreadOptParam option 
)

Create a thread

Example:
 SceUID thid;
 thid = sceKernelCreateThread("my_thread", threadFunc, 0x10000100, 0x10000, 0, 0, NULL);
Parameters:
name- An arbitrary thread name.
entry- The thread function to run when started.
initPriority- The initial priority of the thread. Less if higher priority.
stackSize- The size of the initial stack.
attr- The thread attributes, zero or more of ::Psp2ThreadAttributes.
cpuAffinityMask- The CPU affinity mask
option- Additional options specified by SceKernelThreadOptParam.
Returns:
UID of the created thread, or an error code.
int sceKernelDelayThread ( SceUInt  delay)

Delay the current thread by a specified number of microseconds

Parameters:
delay- Delay in microseconds.
Example:
 sceKernelDelayThread(1000000); // Delay for a second
int sceKernelDelayThreadCB ( SceUInt  delay)

Delay the current thread by a specified number of microseconds and handle any callbacks.

Parameters:
delay- Delay in microseconds.
Example:
 sceKernelDelayThread(1000000); // Delay for a second

Delete a callback

Parameters:
cb- The UID of the specified callback
Returns:
0 on success, < 0 on error
int sceKernelDeleteEventFlag ( int  evid)

Delete an event flag

Parameters:
evid- The event id returned by sceKernelCreateEventFlag.
Returns:
< 0 On error

Delete a message pipe

Parameters:
uid- The UID of the pipe
Returns:
0 on success, < 0 on error
int sceKernelDeleteMutex ( SceUID  mutexid)

Destroy a mutex

Parameters:
mutexid- The mutex id returned from sceKernelCreateMutex
Returns:
Returns the value 0 if its succesful otherwise -1
int sceKernelDeleteSema ( SceUID  semaid)

Destroy a semaphore

Parameters:
semaid- The semaid returned from a previous create call.
Returns:
Returns the value 0 if its succesful otherwise -1

Delate a thread

Parameters:
thid- UID of the thread to be deleted.
Returns:
< 0 on error.
int sceKernelExitDeleteThread ( int  status)

Exit a thread and delete itself.

Parameters:
status- Exit status
int sceKernelExitThread ( int  status)

Exit a thread

Parameters:
status- Exit status.

Get the callback count

Parameters:
cb- The UID of the specified callback
Returns:
The callback count, < 0 on error

Gets the status of a specified callback.

Parameters:
cb- The UID of the callback to retrieve info for.
status- Pointer to a status structure. The size parameter should be initialised before calling.
Returns:
< 0 on error.

Get the status of an event flag.

Parameters:
event- The UID of the event.
status- A pointer to a SceKernelEventFlagInfo structure.
Returns:
< 0 on error.
int sceKernelGetMsgPipeInfo ( SceUID  uid,
SceKernelMppInfo info 
)

Get the status of a Message Pipe

Parameters:
uid- The uid of the Message Pipe
info- Pointer to a SceKernelMppInfo structure
Returns:
0 on success, < 0 on error
int sceKernelGetMutexInfo ( SceUID  mutexid,
SceKernelMutexInfo  info 
)

Retrieve information about a mutex.

Parameters:
mutexid- UID of the mutex to retrieve info for.
info- Pointer to a SceKernelMutexInfo struct to receive the info.
Returns:
< 0 on error.
int sceKernelGetSemaInfo ( SceUID  semaid,
SceKernelSemaInfo info 
)

Retrieve information about a semaphore.

Parameters:
semaid- UID of the semaphore to retrieve info for.
info- Pointer to a SceKernelSemaInfo struct to receive the info.
Returns:
< 0 on error.

Get the system information

Parameters:
info- Pointer to a SceKernelSystemInfo structure
Returns:
0 on success, < 0 on error

Get the current priority of the thread you are in.

Returns:
The current thread priority

Get the exit status of a thread.

Parameters:
thid- The UID of the thread to check.
Returns:
The exit status
int sceKernelGetThreadId ( void  )

Get the current thread Id

Returns:
The thread id of the calling thread.

Get the status information for the specified thread.

Parameters:
thid- Id of the thread to get status
info- Pointer to the info structure to receive the data. Note: The structures size field should be set to sizeof(SceKernelThreadInfo) before calling this function.
Example:
 SceKernelThreadInfo status;
 status.size = sizeof(SceKernelThreadInfo);
 if(sceKernelGetThreadInfo(thid, &status) == 0)
 { Do something... }
Returns:
0 if successful, otherwise the error code.

Get the type of a threadman uid

Parameters:
uid- The uid to get the type from
Returns:
The type, < 0 on error

Retrive the runtime status of a thread.

Parameters:
thid- UID of the thread to retrive status.
status- Pointer to a SceKernelThreadRunStatus struct to receive the runtime status.
Returns:
0 if successful, otherwise the error code.

Get the free stack size for a thread.

Parameters:
thid- The thread ID. Seem to take current thread if set to 0.
Returns:
The free size.
int sceKernelLockMutex ( SceUID  mutexid,
int  lockCount,
unsigned int *  timeout 
)

Lock a mutex

Parameters:
mutexid- The mutex id returned from sceKernelCreateMutex
lockCount- The value to increment to the lock count of the mutex
timeout- Timeout in microseconds (assumed)
Returns:
< 0 On error.
int sceKernelLockMutexCB ( SceUID  mutexid,
int  lockCount,
unsigned int *  timeout 
)

Lock a mutex and handle callbacks if necessary.

Parameters:
mutexid- The mutex id returned from sceKernelCreateMutex
lockCount- The value to increment to the lock count of the mutex
timeout- Timeout in microseconds (assumed)
Returns:
< 0 On error.
int sceKernelNotifyCallback ( SceUID  cb,
int  arg2 
)

Notify a callback

Parameters:
cb- The UID of the specified callback
arg2- Passed as arg2 into the callback function
Returns:
0 on success, < 0 on error
int sceKernelOpenMutex ( const char *  name)

Open a mutex

Parameters:
name- The name of the mutex to open
Returns:
Returns the value 0 if its succesful otherwise -1
int sceKernelPollEventFlag ( int  evid,
unsigned int  bits,
unsigned int  wait,
unsigned int *  outBits 
)

Poll an event flag for a given bit pattern.

Parameters:
evid- The event id returned by sceKernelCreateEventFlag.
bits- The bit pattern to poll for.
wait- Wait type, one or more of Psp2EventFlagWaitTypes or'ed together
outBits- The bit pattern that was matched.
Returns:
< 0 On error
int sceKernelPollSema ( SceUID  semaid,
int  signal 
)

Poll a sempahore.

Parameters:
semaid- UID of the semaphore to poll.
signal- The value to test for.
Returns:
< 0 on error.
int sceKernelReceiveMsgPipe ( SceUID  uid,
void *  message,
unsigned int  size,
int  unk1,
void *  unk2,
unsigned int *  timeout 
)

Receive a message from a pipe

Parameters:
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown
unk2- Unknown
timeout- Timeout for receive
Returns:
0 on success, < 0 on error
int sceKernelReceiveMsgPipeCB ( SceUID  uid,
void *  message,
unsigned int  size,
int  unk1,
void *  unk2,
unsigned int *  timeout 
)

Receive a message from a pipe (with callback)

Parameters:
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown
unk2- Unknown
timeout- Timeout for receive
Returns:
0 on success, < 0 on error

Release a thread in the wait state.

Parameters:
thid- The UID of the thread.
Returns:
0 on success, < 0 on error
int sceKernelRotateThreadReadyQueue ( int  priority)

Rotate thread ready queue at a set priority

Parameters:
priority- The priority of the queue
Returns:
0 on success, < 0 on error.
int sceKernelSendMsgPipe ( SceUID  uid,
void *  message,
unsigned int  size,
int  unk1,
void *  unk2,
unsigned int *  timeout 
)

Send a message to a pipe

Parameters:
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown
unk2- Unknown
timeout- Timeout for send
Returns:
0 on success, < 0 on error
int sceKernelSendMsgPipeCB ( SceUID  uid,
void *  message,
unsigned int  size,
int  unk1,
void *  unk2,
unsigned int *  timeout 
)

Send a message to a pipe (with callback)

Parameters:
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown
unk2- Unknown
timeout- Timeout for send
Returns:
0 on success, < 0 on error
int sceKernelSetEventFlag ( SceUID  evid,
unsigned int  bits 
)

Set an event flag bit pattern.

Parameters:
evid- The event id returned by sceKernelCreateEventFlag.
bits- The bit pattern to set.
Returns:
< 0 On error
int sceKernelSignalSema ( SceUID  semaid,
int  signal 
)

Send a signal to a semaphore

Example:
 // Signal the sema
 sceKernelSignalSema(semaid, 1);
Parameters:
semaid- The sema id returned from sceKernelCreateSema
signal- The amount to signal the sema (i.e. if 2 then increment the sema by 2)
Returns:
< 0 On error.
int sceKernelStartThread ( SceUID  thid,
SceSize  arglen,
void *  argp 
)

Start a created thread

Parameters:
thid- Thread id from sceKernelCreateThread
arglen- Length of the data pointed to by argp, in bytes
argp- Pointer to the arguments.
int sceKernelTryLockMutex ( SceUID  mutexid,
int  lockCount 
)

Try to lock a mutex (non-blocking)

Parameters:
mutexid- The mutex id returned from sceKernelCreateMutex
lockCount- The value to increment to the lock count of the mutex
Returns:
< 0 On error.
int sceKernelTryReceiveMsgPipe ( SceUID  uid,
void *  message,
unsigned int  size,
int  unk1,
void *  unk2 
)

Receive a message from a pipe

Parameters:
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown
unk2- Unknown
Returns:
0 on success, < 0 on error
int sceKernelTrySendMsgPipe ( SceUID  uid,
void *  message,
unsigned int  size,
int  unk1,
void *  unk2 
)

Try to send a message to a pipe

Parameters:
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown
unk2- Unknown
Returns:
0 on success, < 0 on error
int sceKernelUnlockMutex ( SceUID  mutexid,
int  unlockCount 
)

Try to unlock a mutex (non-blocking)

Parameters:
mutexid- The mutex id returned from sceKernelCreateMutex
unlockCount- The value to decrement to the lock count of the mutex
Returns:
< 0 On error.
int sceKernelWaitEventFlag ( int  evid,
unsigned int  bits,
unsigned int  wait,
unsigned int *  outBits,
SceUInt *  timeout 
)

Wait for an event flag for a given bit pattern.

Parameters:
evid- The event id returned by sceKernelCreateEventFlag.
bits- The bit pattern to poll for.
wait- Wait type, one or more of Psp2EventFlagWaitTypes or'ed together
outBits- The bit pattern that was matched.
timeout- Timeout in microseconds
Returns:
< 0 On error
int sceKernelWaitEventFlagCB ( int  evid,
unsigned int  bits,
unsigned int  wait,
unsigned int *  outBits,
SceUInt *  timeout 
)

Wait for an event flag for a given bit pattern with callback.

Parameters:
evid- The event id returned by sceKernelCreateEventFlag.
bits- The bit pattern to poll for.
wait- Wait type, one or more of Psp2EventFlagWaitTypes or'ed together
outBits- The bit pattern that was matched.
timeout- Timeout in microseconds
Returns:
< 0 On error
int sceKernelWaitSema ( SceUID  semaid,
int  signal,
SceUInt *  timeout 
)

Lock a semaphore

Example:
 sceKernelWaitSema(semaid, 1, 0);
Parameters:
semaid- The sema id returned from sceKernelCreateSema
signal- The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
timeout- Timeout in microseconds (assumed).
Returns:
< 0 on error.
int sceKernelWaitSemaCB ( SceUID  semaid,
int  signal,
SceUInt *  timeout 
)

Lock a semaphore and handle callbacks if necessary.

Example:
 sceKernelWaitSemaCB(semaid, 1, 0);
Parameters:
semaid- The sema id returned from sceKernelCreateSema
signal- The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
timeout- Timeout in microseconds (assumed).
Returns:
< 0 on error.
int sceKernelWaitThreadEnd ( SceUID  thid,
int *  stat,
SceUInt *  timeout 
)

Wait until a thread has ended.

Parameters:
thid- Id of the thread to wait for.
stat- Exit status.
timeout- Timeout in microseconds (assumed).
Returns:
< 0 on error.
int sceKernelWaitThreadEndCB ( SceUID  thid,
int *  stat,
SceUInt *  timeout 
)

Wait until a thread has ended and handle callbacks if necessary.

Parameters:
thid- Id of the thread to wait for.
stat- Exit status.
timeout- Timeout in microseconds (assumed).
Returns:
< 0 on error.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines