Lines Matching refs:a

5a set of standards established by IEEE Computer Society to improve the compatibility of different …
11 - **Condition variable**: Communication between threads used to share a mutex. It includes functi…
35 Most Pthreads functions return a value of 0 if they succeed, and an error code contained in the `er…
48 …re.h, and sched.h header files according to the POSIX standard. Pthreads is a sublibrary of libc, …
58a redefinition of the `rt_thread_t` type, defined in the `pthread.h` header file. rt_thread_t is t…
79 This function creates a pthread thread. This function dynamically allocates the POSIX thread data b…
87 The following program initializes two threads, which have a common entry function, but their entry …
253 | EINVAL | Join a thread with a detached state |
258 …and one thread only corresponds to the `pthread_join()` call. A thread with a split state of joina…
349 …inates execution, just as the process calls the exit() function and returns a pointer to the value…
431 Mutexes, also known as mutually exclusive semaphores, are a special binary semaphore. Mutexes are u…
433a mutex at a time. When a thread holds it, the mutex is latched and its ownership is obtained by t…
435 The main APIs of the mutex include: calling `pthread_mutex_init()` to initialize a mutex, `pthread_…
437a priority inheritance algorithm to prevent priority inversion.Priority inheritance is the practic…
439 For a detailed introduction to priority reversal, please refer to the @ref page_thread_sync Mutex s…
443a mutex control block that contains some information about the control of the mutex. Before creati…
453 //rt_mutex is a data structure defined in the RT-Thread kernel, defined in the rtdef.h header file.…
461 struct rt_thread *owner; /* Thread that currently has a mutex */
463 typedef struct rt_mutex* rt_mutex_t; /* Rt_mutext_t is a pointer to the mutex structure…
482 In addition to calling the pthread_mutex_init() function to create a mutex, you can also statically…
516 | EDEADLK | Mutexes mutex do not call this function repeatedly for a thread with a nested lock |
518a wrapper of the rt_mutex_take() function. If the mutex has not been locked yet, the thread applyi…
535 This function is a non-blocking version of the pthread_mutex_lock() function. The difference is tha…
549 | EPERM | This function is called repeatedly by a thread when the mutex is not a nested lock |
552a wrapper of the rt_mutex_release() function. When the thread completes the access of the shared r…
556a time, then sleep for 1 second, call printer The thread of the () function also sleeps. If you do…
624 /* Initialize a mutex */
641 …is actually a semaphore used for synchronization between threads. A condition variable is used to …
643a thread that processes a shared resource queue finds that the queue is empty, then the thread can…
645 …to destroy a condition variable, calling `pthread_cond_wait()` to wait for a condition variable, a…
649a condition variable control block, including some information about the operation of the conditio…
659 Rt_semaphore is a data structure defined in the RT-Thread kernel. It is a semaphore control block d…
682 …ccording to the condition variable property pointed to by `attr` , which is a wrapper of the `rt_s…
684 You can also statically initialize a condition variable with the macro PTHREAD_COND_INITIALIZER by:…
705 Before destroying a condition variable, you need to make sure that no threads are blocked on the co…
721 …le. If it is not available, initializes a condition variable, then unlocks the mutex and then trie…
744 ## Send a Conditional Semaphore
756a signal and wakes up only one thread waiting for the `cond` condition variable, which encapsulate…
775a producer consumer model with a producer thread and a consumer thread that have the same priority…
783 /* Statically initialize a mutex and a condition variable */
810 struct node* head = NULL; /* Link header, is a shared resource */
823 pthread_cond_wait(&cond,&mutex); /* Try to get a condition variable */
847 /* Dynamically allocate a block of structured memory */
860 pthread_cond_signal(&cond); /* send a Signal to wake up a thread */
876 …/* Create a producer thread, the property is the default value, the entry function is product, and…
880 …/* Create a consumer thread, the property is the default value, the entry function is consumer, an…
892 …implemented based on mutex locks and condition variables. A thread can lock a read-write lock seve…
894 The main operations of the read-write lock include: calling `pthread_rwlock_init()` to initialize a
898a read-write lock control block, including some information about the operation of the read-write …
932 …NITIALIZER` (structural constant), which is equivalent to specifying `attr` a NULL value when call…
948 | EBUSY | The read-write lock is currently being used or has a thread waiting for the read-write l…
951 This function destroys a `rwlock` read-write lock, which destroys the mutex and condition variables…
983 | EBUSY | The read-write lock is currently being used or has a thread waiting for the read-write l…
1009 ### Blocking Mode Write-Locks a Read-write Lock
1023a mutex, and only one thread can write-lock a read-write lock at a time. If no thread locks the re…
1025 ### Non-blocking Mode Write-Lock a Read-write Lock
1040 The only difference between this function and the pthread_rwlock_wrlock() function is that if a thr…
1058 The only difference between this function and the pthread_rwlock_wrlock() function is that if a thr…
1152 …/* Create a reader1 thread, the thread entry is reader1_entry, the thread attribute is the default…
1156 …/* Create a reader2 thread, the thread entry is reader2_entry, the thread attribute is the default…
1160 …/* Create a writer1 thread, the thread entry is writer1_entry, the thread attribute is, and the en…
1170 Barriers are a way to synchronize multithreading. Barrier means a barrier or railing that blocks mu…
1172 …ialize a barrier, and other threads calling `pthread_barrier_wait()`. After all threads arrived, t…
1176 Before creating a barrier, you need to define a `pthread_barrier_t` barrier control block. `pthread…
1188 ## Create a Barrier
1198 …f passing NULL, use the default value. PTHREAD_PROCESS_PRIVATE must be used as a non-NULL value. |
1205 This function creates a `barrier` barrier and initializes the conditional variables and mutex locks…
1222 This function destroys a barrier. The barrier's properties and control block parameters will not be…
1241 This program will create 3 threads, initialize a barrier, and the barrier waits for 3 threads. 3 t…
1340 … processes and processes, or between in-process threads. Each semaphore has a semaphore value that…
1344 … only 0 and 1, and the initial value is specified as 1. This is the same as a mutex. If the resour…
1346a limit greater than 1 (POSIX indicates that the system's maximum limit is at least 32767). This c…
1350 - A named semaphore: its value is stored in a file and is generally used for inter-process synchr…
1354 The POSIX semaphore of the RT-Thread operating system is mainly based on a package of RT-Thread ker…
1358 …e corresponds to a semaphore control block. Before creating a semaphore, you need to define a sem_…
1378 /* rt_sem_t is a pointer type to the semaphore structure */
1402 …ore value after initialization is the given initial value. This function is a wrapper of the rt_se…
1421 A named semaphore whose value is stored in a file and is generally used for inter-process synchroni…
1423 ### Create or Open a Named Semaphore
1437a new semaphore based on the semaphore name or opens an existing semaphore. The optional values fo…
1452 This function looks up the semaphore based on the semaphore name, and marks the semaphore as a deta…
1467a thread terminates,it closes the semaphore it occupies. Whether the thread terminates voluntarily…
1498a wrapper of the `rt_sem_take(sem,RT_WAITING_FOREVER)` function. If the semaphore value is greater…
1513 This function is a non-blocking version of the sem_wait() function and is a wrapper of the `rt_sem_…
1544 This function will release a sem semaphore, which is a wrapper of the rt_sem_release() function. If…
1548 A typical case of semaphore usage is the producer consumer model. A producer thread and a consumer …
1550 …data is not empty, and a mutex is used to protect the shared resource. After the producer thread p…
1559 /* Statically initialize a mutex to protect shared resources */
1587 struct node* head = NULL; /* Link header, a shared resource */
1611 sem_post(&empty_sem); /* Send a null semaphore to the producer */
1622 /* Dynamically allocate a block of structured memory */
1635 sem_post(&full_sem); /* Send a full semaphore to the consumer */
1653 …/* Create a producer thread, the property is the default value, the entry function is product, and…
1657 …/* Create a consumer thread, the property is the default value, the entry function is consumer, an…
1667 …d when the message queue is empty, the reader thread can be suspended. When a new message arrives,…
1669 …ion `mq_open()`, calling `mq_send()` to send a message to the message queue, calling `mq_receive()…
1671 …n. The POSIX message queue of RT-Thread operating system is mainly based on a package of RT-Thread…
1675 Each message queue corresponds to a message queue control block. Before creating a message queue, y…
1681 …rt_uint16_t unlinked; /* Separation status of the message queue, a value of 1 indicates that the …
1688 ## Create or Open a Message Queue
1702a new message queue or opens an existing message queue based on the name of the message queue. The…
1717 …ased on the message queue name name. If found, it sets the message queue to a detached state. If t…
1732 When a thread terminates,it closes the message queue it occupies. Whether the thread terminates vol…
1734 ## Block Mode to Send a Message
1753 This function is used to send a message to the `mqdes` message queue, which is a wrapper of the rt_…
1757 ## Specify Blocking Time to Send a Message
1884 /* Send a message to the message queue */
1958 This section provides a detailed introduction to some of the rarely used property objects and relat…
1994 …to NULL when calling the thread initialization function. You need to define a `pthread_attr_t` att…
2000 Setting or getting the separation state of a thread is as follows. By default, the thread is non-s…
2016a thread determines how a thread reclaims the resources it occupies after the end of its run. Ther…
2062 Set / Obtain the stack size of a thread is as follows:
2076 …quired on most systems (for example, the ARM architecture needs to be aligned to a 4-byte address).
2080 Set / Obtain the stack address and stack size of a thread is as follows:
2119a common entry function, but their entry parameters are not the same. The first thread created wil…
2183 Cancellation is a mechanism that allows one thread to end other threads. A thread can send a cancel…
2199 This function sends a cancel request to the `thread` thread. Whether the thread will respond to the…
2243 …eates a cancellation point where the thread is called. Called primarily by a thread that does not …
2287 …run count information in an infinite loop. After thread2 wakes up, it sends a cancel request to th…
2330 /* Send a cancel request to thread 1 */
2391 …irst function from the header of the cleanup function list. If `execute` is a non-zero value, then…
2426 sched_get_priority_min() returns a value of 0, with the highest priority in RT-Thread and sched_get…
2480 The type of mutex determines how a thread behaves when it acquires a mutex. RT-Thread implements th…
2482a thread is locked, the remaining threads requesting the lock will form a wait queue, and after un…
2484 - **PTHREAD_MUTEX_RECURSIVE**: Nested locks that allow a thread to successfully acquire the same …
2486 - **PTHREAD_MUTEX_ERRORCHECK**: Error checking lock, if a thread tries to regain the mutex withou…
2498 | attr | Pointer to a condition variable property object |
2511 | attr | Pointer to a condition variable property object |