Also, I have defined two macros
<https://github.com/vivek-roy/haiku/blob/3c024be9dd0580a98722996fd16a655f9b6ca42b/headers/compatibility/linuxkpi/asm/atomic.h#L60>
:
#define unlikely(x) x
#define likely(x) x
I should probably change them to
#define unlikely(x) (x)
#define likely(x) (x)
But is that okay? Should I have them in a separate header (as it is used
everywhere in the linux kernel), or something better?
On Tue, Jun 20, 2017 at 7:57 PM, Vivek Roy <vivekroyandroid@xxxxxxxxx>
wrote:
Fixed it here
<https://github.com/vivek-roy/haiku/commit/3c024be9dd0580a98722996fd16a655f9b6ca42b>.
Thanks Hamish and Jérôme.
I haven't implemented mutex_is_locked() here
<https://github.com/vivek-roy/haiku/commit/1886cb791345b08c2b980f8ac4f05f806b2e9dd0>.
Any help with that?
On Tue, Jun 20, 2017 at 6:42 PM, Hamish Morrison <hamishm53@xxxxxxxxx>
wrote:
On Tue, Jun 20, 2017 at 9:18 AM, Vivek Roy <vivekroyandroid@xxxxxxxxx>
wrote:
Also,
I have made some changes to my previous implementation of asm/atomic.h
Julian, please check.
Your atomic_swap is not atomic. Consider what would happen if another
thread modified the variable between the calls to atomic_get and
atomic_set.