Re: Adding reentrancy information to safety notes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 31, 2014, "Carlos O'Donell" <carlos@xxxxxxxxxx> wrote:

> A function is synchronously reentrant if a thread may safely
> call the function before a previous call to the same function
> by the same thread completes, but need not be safe if the
> second or subsequent calls are made while handling an
> asynchronous signal or by another thread.

I'd qualify the asynchronous signal to state that it need not be safe
only if the signal interrupted asynchronously the execution of the
previous call, otherwise it would also allow a(n indirectly) recursive
function, called from the signal handler for the first time, to be
unsafe when called recursively.

I.e., stack traces such as:

  foo
  bar
  foo
  [...]
  <signal>
  [...no foo...]
  main

should be just as safe as:

  foo
  bar
  foo
  [...no foo...]
  main

but it's ok if foo is unsafe here:

  foo
  bar
  [...]
  <signal>
  [...]
  foo
  [...]

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux