Thread: SpinLockAcquire question

SpinLockAcquire question

From
Boszormenyi Zoltan
Date:
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/



Re: SpinLockAcquire question

From
Tom Lane
Date:
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