
--------------
Existing locks
--------------

- liberic_config:

	* global_mtx

		+ recursive mutex
		+ not visible outside the library
		+ protects access to the global config
		+ threads: nearly all

	* users_mtx (recursive)

		+ recursive mutex
		+ not visible outside the library
		+ protects access to the users and its config
		+ threads: nearly all

- liberic_base:

	* snmp_trap_mtx

		+ normal mutex (not error checking), since trivial
		+ local to the routine
		+ protects the routine that sends SNMP traps
		+ threads: Webs

- liberic_net:

	* crypto_locks (array)

		+ normal mutexes (should possible be error checking ones)
		+ not used outside OpenSSL
		+ protect the crypto routines in OpenSSL
		+ threads: all threads making SSL net io

	* rsa_tmp_mtx

		+ normal mutex (not error checking), since trivial
		+ local to the routine
		+ protect key generation in RSA callback

	* request_mtx

		+ error checking mutex (not raelly necessary since trivial)
		+ local to the source file
		+ protects processing of HTTP requests

- liberic_km:

	* km_lock

		+ error checking mutex
		+ local to the source file
		+ synchronizes concurrent access to the km_routines
		+ threads: Reader

- liberic_session:

	* sessions_mtx

		+ recursive mutex
		+ local to the source file
		+ protects the hash with all sessions

- liberic_webs:

	* balloc_mtx

		+ normal mutex (trival)
		+ local to the source file
		+ protects balloc routine (not really necessary at the moment
		  since we hold a global lock for HTTP requests)
		+ threads: Webs

- liberic_grab:

	* info_mtx

		+ error checking mutex
		+ used in liberic_rfb too
		+ protects the update of the frame buffer info structure
		+ threads: Grabber/Reader/Writer

- liberic_rfb:

	* clients_head_mtx

		+ error checking mutex
		+ local to the source file
		+ protects the list of all RFB clients
		+ threads: Grabber/Reader

	* rfb_ptr_clp_mtx

		+ error checking mutex
		+ local to the library
		+ protects a variable holding a pointer to the client that
		  holds the mouse pressed
		+ threads: Reader

	* client_init_mtx

		+ error checking mutex
		+ local to the routine
		+ protects some code that not used at the moment
		+ threads: Reader

	* send_rect_mtx

		+ normal mutex (trivial)
		+ local to the routine
		+ synchronizes access to the tight encoder (not threadsafe yet)
		+ threads: Writer

	* s2c_queue_mtx

		+ error checking mutex
		+ local to the library
		+ every client has its own mutex
		+ synchronizes access to the write queue
		+ threads: Grabber/Reader/Writer

	* upd_mtx

		+ error checking mutex
		+ local to the library
		+ every client has its own mutex
		+ synchronizes access to the requested-/modified-/copy-region
		+ threads: Grabber/Reader/Writer

