Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor10800221080022 Mutual Exclusion Semaphores Anchor10800231080023 Table C-11 The table below shows the difference in API for mutual exclusion semaphore management.anchor

Panel

...

1089777
HTML Table
summary
classPlain_Table
Table Row (tr)
Table Cell (td)
Anchor
1089777
titleMutual Exclusion Semaphores API


µC/OS-II (os_mutex.c)
td
Anchor
10897791089779
µC/OS-III (os_mutex.c)
td
Anchor10897811089781
Note
tr1089789 OSMutexAccept( Anchor10897951089795 OS_EVENT *pevent, Anchor10898011089801 INT8U *perr); Table Cell (td)
rowspan5
Anchor10897851089785   Table Cell (td)
rowspan5
Anchor10898111089811 (1) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan5
Anchor10898131089813 OS_EVENT * Anchor10898191089819 OSMutexCreate( Anchor10898251089825 INT8U prio, Anchor10898311089831 INT8U *perr); Table Cell (td)
rowspan5
Anchor10902031090203 void Anchor10902041090204 OSMutexCreate( Anchor10902051090205 OS_MUTEX *p_mutex, Anchor10902061090206 CPU_CHAR *p_name, Anchor10902071090207 OS_ERR *p_err); Table Cell (td)
rowspan5
Anchor10902091090209 (2) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan6
Anchor10898731089873 OS_EVENT * Anchor10898791089879 OSMutexDel( Anchor10898851089885 OS_EVENT *pevent, Anchor10898911089891 INT8U opt, Anchor10898971089897 INT8U *perr); Table Cell (td)
rowspan6
Anchor10899051089905 void Anchor10902381090238 OSMutexDel( Anchor10902391090239 OS_MUTEX *p_mutex, Anchor10902401090240 OS_OPT opt, Anchor10902301090230 OS_ERR *p_err); Table Cell (td)
rowspan6
Anchor10898771089877   Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan6
Anchor10899391089939 void Anchor10899451089945 OSMutexPend( Anchor10899511089951 OS_EVENT *pevent, Anchor10899571089957 INT32U timeout, Anchor10899631089963 INT8U *perr); Table Cell (td)
rowspan6
Anchor10902721090272 void Anchor10902731090273 OSMutexPend( Anchor10902741090274 OS_MUTEX *p_mutex, Anchor10902751090275 OS_TICK timeout, Anchor10902761090276 OS_OPT opt, Anchor10902771090277 CPU_TS *p_ts, Anchor10902781090278 OS_ERR *p_err); Table Cell (td)
rowspan6
Anchor10902801090280 (3) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td) Anchor10900171090017   Table Cell (td) Anchor10900191090019 OS_OBJ_QTY Anchor10903111090311 OSMutexPendAbort( Anchor10903121090312 OS_MUTEX *p_mutex, Anchor10903131090313 OS_OPT opt, Anchor10903141090314 OS_ERR *p_err); Table Cell (td) Anchor10900211090021   Table Row (tr) Table Cell (td)
rowspan4
Anchor10900531090053 INT8U Anchor10900591090059 OSMutexPost( Anchor10900651090065 OS_EVENT *pevent); Table Cell (td)
rowspan4
Anchor10900731090073 void Anchor10903541090354 OSMutexPost( Anchor10903551090355 OS_MUTEX *p_mutex, Anchor10903561090356 OS_OPT opt, Anchor10903461090346 OS_ERR *p_err); Table Cell (td)
rowspan4
Anchor10900571090057   Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan4
Anchor10901071090107 INT8U Anchor10901131090113 OSMutexQuery( Anchor10901191090119 OS_EVENT *pevent, Anchor10901251090125 OS_MUTEX_DATA
Table Cell (td)
rowspan5
Anchor10897831089783 BOOLEAN Anchor1089789rowspan
BOOLEAN
OSMutexAccept(
    OS_EVENT       *pevent,
    INT8U          *perr);

(1)
OS_EVENT *
OSMutexCreate(
    INT8U           prio,
    INT8U          *perr);
void
OSMutexCreate(
    OS_MUTEX   *p_mutex,
    CPU_CHAR   *p_name,
    OS_ERR     *p_err);
(2)
OS_EVENT *
OSMutexDel(
    OS_EVENT       *pevent,
    INT8U           opt,
    INT8U          *perr);
void
OSMutexDel(
    OS_MUTEX   *p_mutex,
    OS_OPT      opt,
    OS_ERR     *p_err);

void
OSMutexPend(
    OS_EVENT       *pevent,
    INT32U          timeout,
    INT8U          *perr);
void
OSMutexPend(
    OS_MUTEX   *p_mutex,
    OS_TICK     timeout,
    OS_OPT      opt,
    CPU_TS     *p_ts,
    OS_ERR     *p_err);
(3)

OS_OBJ_QTY
OSMutexPendAbort(
    OS_MUTEX   *p_mutex,
    OS_OPT      opt,
    OS_ERR     *p_err);

INT8U
OSMutexPost(
    OS_EVENT       *pevent);
void
OSMutexPost(
    OS_MUTEX   *p_mutex,
    OS_OPT      opt,
    OS_ERR     *p_err);

INT8U
OSMutexQuery(
    OS_EVENT       *pevent,
    OS_MUTEX_DATA  *p_mutex_data);
Table Cell (td)

(4)
anchor



  (4)
Panel
10901091090109
Table Cell (td)
rowspan4
Anchor
10901111090111
Table Row (tr)
Table Row (tr)
Table Row (tr)

...

bgColor#f0f0f0

(1) In µC/OS-III, there is no “accept” API, since this feature is built into the OSMutexPend() by specifying the OS_OPT_PEND_NON_BLOCKING option.

...

(2) In µC/OS-II, OSMutexCreate() returns the address of an OS_EVENT, which is used as the “handle” to the message mailbox. In µC/OS-III, the application must allocate storage for an OS_MUTEX, which serves the same purpose as the OS_EVENT. The benefit in µC/OS-III is that it is not necessary to predetermine the number of mutual-exclusion semaphores at compile time.

...

(3) µC/OS-III returns additional information when a mutex is released. The releaser takes a snapshot of the current time stamp and stores it in the OS_MUTEX. The new owner of the mutex therefore knows when the mutex was released.

...

(4) µC/OS-III does not provide query services as they were rarely used.