Re: [libopendkim] dkim_init() and dkim_close() thread problems
On Tue, 27 Apr 2010, Dino Ciuffetti wrote:
> I have a crash problem calling dkim_init(NULL, NULL) and dkim_close()
> into pthreads. Do I have to protect dkim_init(NULL, NULL) and
> dkim_close() calls with a mutex lock into a multi threaded
> implementation? If it is so I did not found the info from the
> documentation.
No, the calls are thread-safe. dkim_init() allocates a data structure and
possibly some substructures, and returns a pointer to what got allocated.
There's nothing in there that should cause a concurrency problem.
dkim_close() should only be called as your program is exiting (or at least
not using libopendkim anymore), and all it does is undo what dkim_init()
did. Ideally there should be no other threads using the library at that
point so I don't know how you might have a concurrency issue there.
Do you have a stack trace that shows the problem?
Received on Tue Apr 27 2010 - 13:52:47 PST
This archive was generated by hypermail 2.3.0
: Mon Oct 29 2012 - 23:19:47 PST