This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, newlib] Allow locking routine to be retargeted


On Thu, 2016-11-24 at 08:44 +0100, Sebastian Huber wrote:
> 3)
> 
> struct _lock;
> 
> typedef struct _lock *_LOCK_T;
> 
> #define __LOCK_INIT(class, lock) extern struct _lock _lock_ ## lock;
> class _LOCK_T lock = &_lock_ ## lock;
> 
> The OS must then provide struct _lock and storage for all statically
> initialized locks.

Good and simple, changes almost nothing in newlib's code, easy to have
both recursive and non-recursive locks.

+1

I think it would be possible to get rid of the "class _LOCK_T lock =
&_lock_ ## lock;" part. For example with macros like:

#define __tz_lock_object &__tz_lock_storage

Regards,
FCh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]