Threads and Fossil

It is strictly illegal to use a given fsl_cx instance from more than one thread.


It is legal for multiple contexts to be running in multiple threads, but only if those contexts use different repository/checkout databases. Though access to the storage is, through sqlite, protected via a mutex/lock, this library does not have a higher-level mutex to protect multiple contexts from colliding during operations. So... don't do that. One context, one repo/checkout.

Multiple application instances may each use one fsl_cx instance to share repo/checkout db files, but must be prepared to handle locking-related errors in such cases. e.g. db operations which normally "always work" may suddenly pause for a few seconds before giving up while waiting on a lock when multiple applications use the same database files. sqlite's locking behaviours are documented in great detail at