SpinLockAcquire question

Started by Boszormenyi Zoltanover 15 years ago2 messages
#1Boszormenyi Zoltan
zb@cybertec.at

Hi,

is there a danger in using SpinLockAcquire() in
a signal handler? I mean if e.g. a spinlock is already
taken by the process and a signal comes that's handler
wants to execute SpinLockAcquire() again, does it
lock up or simply increases the lock counter?

Thanks in advance,
Zolt�n B�sz�rm�nyi

--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

----------------------------------
Zolt�n B�sz�rm�nyi
Cybertec Sch�nig & Sch�nig GmbH
http://www.postgresql.at/

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Boszormenyi Zoltan (#1)
Re: SpinLockAcquire question

Boszormenyi Zoltan <zb@cybertec.at> writes:

is there a danger in using SpinLockAcquire() in
a signal handler?

Yes. Actually, pretty much anything beyond setting a "volatile" flag
variable is too dangerous.

regards, tom lane