[geos-devel] Thread safe error handling
Sandro Santilli
strk at keybit.net
Sat Sep 7 06:32:59 PDT 2013
On Sat, Sep 07, 2013 at 01:23:25AM +0200, Pepijn Van Eeckhoudt wrote:
> Hi,
>
> I'm using GEOS via the C api in libgpkg to implement geometry functions. I got the basics working now, but it feels like I had to jump through a lot of hoops to get the error handling set up reliably. The main problem I had was that there's no way to associate user data with the error and notice callbacks. Since this library may be used in a multi-threaded context I ended up having to use thread-local storage to store the error message. This feels more complicated than it should be.
>
> Is there a simpler way to achieve the same result with the current API that I might have missed?
Not really. If you have ideas for extending the interface in a backward
compatible way, a patch would be accepted.
--strk;
More information about the geos-devel
mailing list