[erlang-patches] Remove mutex lock around sys_gettimeofday() in os:timestamp/0

Tuncer Ayaz <>
Sat Jan 23 11:22:01 CET 2010


2010/1/23 Björn Gustavsson <>:
> On Sat, Jan 23, 2010 at 12:41 AM, Tuncer Ayaz <> wrote:
>> Remove mutex lock around sys_gettimeofday() in os:timestamp/0
>>
>> In the erlang-questions thread "os:timestamp() uses mutex lock"
>> Jonas Falkevik questioned the need for a mutex lock in os:timestamp/0.
>> Kenneth Lundin confirmed that the lock is not needed and asked for
>> a patch.
>>
>> git fetch git://github.com/tuncer/otp.git os_timestamp_no_mutex
>
> Thanks!
>
> Since you seems to have based your branch on 'pu', I have rebased
> your branch on ccase/r13b04_dev.

Thanks, I wondered why Kenneth wrote
"provide it as a patch to the pu branch"
and due to that confusion branched off pu.
My last patch was branched off ccase/r13b04_dev :).

> Since I have touched the commit anyway, I also edited the
> commit message to be more informative regarding the
> technical details:
>
>    In the erlang-questions thread "os:timestamp() uses mutex lock"
>    Jonas Falkevik questioned the need for a mutex lock in
>    os:timestamp/0. The mutex lock *is* needed in erlang:now()
>    to guarantee the uniqueness of the returned time, but serves
>    no useful purpose in os:timestamp().
>
> If you are not happy with this change, please edit the text and
> submit the branch again.

I can redo the branch with the changed commit message
if you prefer.

> (I will push 'pu' with your branch included later today.)


More information about the erlang-patches mailing list