Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 28 Feb 2022 09:48:14 +0100
From: Joakim Sindholt <opensource@...sha.com>
To: musl@...ts.openwall.com
Subject: Re: Suggestion for thread safety

On Sun, 27 Feb 2022 23:32:47 +0000, Lee Shallis <gb2985@...il.com> wrote:
> Yes, as I mentioned before, pauseCB is supposed to have it's pointer
> be changed by the developer, in other words you forgot to plugin a
> pthreads compatible call prior to your threads starting, considering
> you made that mistake I suppose it is a good thing I since switched to
> a non-redirectable pointer:

How many times do you want to do this?

zhasha@...belwind /home/zhasha ; gcc -D_GNU_SOURCE -lpthread buglock.c
zhasha@...belwind /home/zhasha ; ./a.out
var = 1, expected 0
zhasha@...belwind /home/zhasha ; ./a.out
var = 1, expected 0
zhasha@...belwind /home/zhasha ; ./a.out
var = 1, expected 0
zhasha@...belwind /home/zhasha ; ./a.out
var = 1, expected 0
zhasha@...belwind /home/zhasha ; ./a.out
var = 1, expected 0
var = 2, expected 1
zhasha@...belwind /home/zhasha ; ./a.out
var = 1, expected 0
var = 2, expected 1

View attachment "buglock.c" of type "text/plain" (1476 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.