Changes between Version 147 and Version 148 of library_stdio
- Timestamp:
- Mar 3, 2016, 1:24:29 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
library_stdio
v147 v148 37 37 This functions activates one thread that will execute the C function defined by the <function> argument. 38 38 All thread activated by this system call must have been defined in the application mapping. 39 The <attr> argument (pthread attributes) is not supported, and should be set to NULL: The stack size must be defined in the mapping, and the pthread is activated in ''attached'' mode. In the current implementation, the <arg> argument (argument to be passed to the function) is not supported, and should be set to NULL. 40 The thread identifier stored in the <trdid> argument by the kernel is unique in a given space: It is actually build from the 4 following informations : [x,y,p,ltid] where x,y,p are the processor coordinates, and ltid is the thread index in the scheduler. 41 * '''trdid''' : pointer on a buffer that will contain the activated thread identifier. 42 * '''attr''' : not supported in the current implementation / must be set to NULL. 43 * '''function''' : pointer on function 44 * '''arg''' : not supported in the current implementation / must be set to NULL. 39 The <attr> argument (pthread attributes) is not supported, and should be set to NULL : The stack size must be defined in the mapping, and the pthread is activated in ''attached'' mode. The <arg> argument is a pointer on an user-defined structure containing the arguments to be passed to the called function. It can be set to NULL if the function has no arguments. 40 The thread identifier stored in the <trdid> argument by the kernel is unique in a given vspace: It is actually build from the 4 following informations : [x,y,p,ltid] where x,y,p are the processor coordinates, and ltid is the thread index in the scheduler. 41 45 42 Return 0 if success. 46 43 Return -1 if no matching thread. 47 Return -2 if attr or argnot NULL.44 Return -2 if attr not NULL. 48 45 49 46 === 2) void '''giet_pthread_exit'''( void* string ) === 50 This function send a KILL signal to the calling thread, that is immediately desactivated, and goes to the ''blocked'' state. All resources dynamically allocated to the thread, such as private peripheral channels are released. An user defined message is displayed on the kernel terminal TTY0. 51 * '''string''': message on TTY0. 47 This function send a KILL signal to the calling thread, that is immediately desactivated, and goes to the ''blocked'' state. All resources dynamically allocated to the thread, such as private peripheral channels are released. The user defined <string> message is displayed on the kernel terminal TTY0. 52 48 53 49 === 3) int '''giet_pthread_join'''( pthread_t trdid , void* ptr ) === … … 55 51 It returns only when the thread identified by the <trdid> argument is desactivated. 56 52 The <ptr> argument is not supported, and should be set to NULL. 57 * '''trdid''' : unique thread identifier in vspace. 58 * '''ptr''' : not supported. 53 59 54 Return 0 if success. 60 55 Return -1 if no matching thread. … … 65 60 If the <signal> argument has a non zero value, the target thread will be deactivated at the next context switch. 66 61 If the <signal> argument is zero, the thread existence is checked, but the KILL signal it is not sent. 67 * '''trdid''' : thread identifier in vspace. 68 * '''signal''' : deactivation if non zero. 62 69 63 Return 0 if success. 70 64 Return -1 if no matching thread. … … 78 72 This function is an extension to the POSIX standard. It send a KILL signal and deactivates immediately the calling thread (as does the giet_pthread_exit() function), with a message on 79 73 the kernel TTY0, if the <condition> argument has a zero value. The message is defined by the <string> argument. 80 * '''condition''' : thread exit if condition value is 0.81 * '''string''' : message displayed on TTY0.82 74 83 75 === 7) void '''giet_pthread_control'''( unsigned int command , char* vspace , char* thread ) === 84 76 This function is an extension to the POSIX standard. It execute the command defined by the<command> argument for the thread identified by the <vspace> and <thread> arguments. 85 * '''command''' : command type. 86 * '''vspace''' : vspace name. 87 * '''thread''' : thread name in mapping. 77 88 78 The supported command types are: 89 79 * '''THREAD_CMD_PAUSE''' : The target thread is deactivated. It goes immediately to the ''blocked'' state, and will not be scheduled until the thread is reactivated. The thread context (including the resources dynamically allocated to the thread) is not modified.