| Function report | 
| Source Code: ipc\sem.c | Create Date:2022-07-28 16:43:51 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:perform_atomic_semop
Proto:static int perform_atomic_semop(struct sem_array *sma, struct sem_queue *q)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct sem_array * | sma | |
| struct sem_queue * | q | 
| 707 | nsops = umber of operations | 
| 708 | un = undo structure | 
| 710 | If Value for the false possibility is greater at compile time(sops on more than one sem_num ) Then Return perform_atomic_semop[_slow] - Attempt to perform semaphore* operations on a given array | 
| 723 | sem_op = semaphore operation | 
| 724 | result = current value | 
| 726 | If Not sem_op && result Then Go to would_block | 
| 730 | If result < 0 Then Go to would_block | 
| 733 | If result > <= 32767 semaphore maximum value Then Return -ERANGE | 
| 736 | If peration flags & undo the operation on exit Then | 
| 737 | undo = array of adjustments [semaphore index in array ] - sem_op | 
| 740 | If undo < -adjust on exit max value - 1 || undo > adjust on exit max value Then Return -ERANGE | 
| 746 | curr = sems[semaphore index in array ] | 
| 747 | sem_op = semaphore operation | 
| 748 | result = current value | 
| 750 | If peration flags & undo the operation on exit Then | 
| 751 | undo = array of adjustments [semaphore index in array ] - sem_op | 
| 755 | current value += sem_op | 
| 759 | Return 0 | 
| 761 | would_block : | 
| 762 | he operation that blocked = sop | 
| 763 | Return If peration flags & urn error on wait Then -EAGAIN Else 1 | 
| Name | Describe | 
|---|---|
| wake_const_ops | wake_const_ops - wake up non-alter tasks*@sma: semaphore array.*@semnum: semaphore that was modified.*@wake_q: lockless wake-queue head.* wake_const_ops must be called after a semaphore in a semaphore array* was set to 0 | 
| update_queue | pdate_queue - look for tasks that can be completed.*@sma: semaphore array.*@semnum: semaphore that was modified.*@wake_q: lockless wake-queue head.* update_queue must be called after a semaphore in a semaphore array* was modified | 
| do_semtimedop | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |