uwrap: Optimalization of uid_wrapper_enabled() function.
authorRobin Hack <hack.robin@gmail.com>
Fri, 23 Jan 2015 14:15:04 +0000 (15:15 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 28 Jan 2015 16:17:07 +0000 (17:17 +0100)
commit0830d93eece7e0d132c1513c195d7735cf3421da
tree59402423dc0b87b5b22a95076f2844e028095b17
parentb21106a1a1c940151d2e56608aea35dab714b773
uwrap: Optimalization of uid_wrapper_enabled() function.

Check only bool variable inside uwrap structure instead
of calling whole uid_init().

In the best case only one mutex lock is need when check.

NOTES:
 * This patch uses __atomic_load gcc builtin function.
 * uid_init() were moved outside uid_wrapper_enabled() function.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/uid_wrapper/uid_wrapper.c
lib/uid_wrapper/wscript