Changeset c4c90c8 in mainline for uspace/lib/c/include/fibril_synch.h


Ignore:
Timestamp:
2023-07-14T12:41:19Z (15 months ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
ticket/834-toolchain-update
Children:
10e56b7
Parents:
b030416
git-author:
Vojtech Horky <vojtech.horky@…> (2023-07-13 20:05:54)
git-committer:
Vojtech Horky <vojtech.horky@…> (2023-07-14 12:41:19)
Message:

C++: mutex::init should be constexpr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/fibril_synch.h

    rb030416 rc4c90c8  
    153153extern void __fibril_synch_fini(void);
    154154
    155 extern void fibril_mutex_initialize(fibril_mutex_t *);
     155/** Initialize fibril mutex.
     156 *
     157 * Kept as in-line to allow constexpr marker for C++ library where this
     158 * is used by C++ mutex type (list initialization are two assignments
     159 * so it is actually reasonable to have this inlined).
     160 */
     161static inline __CONSTEXPR void fibril_mutex_initialize(fibril_mutex_t *fm)
     162{
     163        fm->oi.owned_by = NULL;
     164        fm->counter = 1;
     165        list_initialize(&fm->waiters);
     166}
     167
    156168extern void fibril_mutex_lock(fibril_mutex_t *);
    157169extern bool fibril_mutex_trylock(fibril_mutex_t *);
Note: See TracChangeset for help on using the changeset viewer.