Home GnuPG

Replace locking code in estream functions.
fc6516650100Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Replace locking code in estream functions.

* src/posix-lock.c: Add weak program for pthread_mutex_trylock.
(_gpgrt_lock_trylock): New.
* src/w32-lock.c (_gpgrt_lock_init): Add missing return statement.
(_gpgrt_lock_trylock): New.
* src/visibility.c (gpgrt_set_syscall_clamp): New.
(gpgrt_lock_trylock): New.
(gpgrt_vsnprintf): Fix symbol name.
* src/init.c (DllMain): Mark unused arg.
* src/estream.c: Replace npth mutexes by our own locks.  Replace yeild
macro by _gpgrt_yield.
(pre_syscall_func, post_syscall_func): New.
(do_deinit): Clear both new vars.
(es_func_fd_read, es_func_fd_write): Call pre and post syscall
functions instead of the former SYSCALL macros.
(es_func_w32_read, es_func_w32_write): Ditto.
(es_func_fd_seek, es_func_w32_seek, es_func_fp_read)
(es_func_fp_write, es_func_fp_seek, es_func_fp_destroy): Bracket
syscalls with the pre- and post-syscall fucntions.
(do_npth_read, do_npth_write): Remove.
(_gpgrt_es_init): Remove call to mutex init.  It is now statically
initialized.
(_gpgrt_set_syscall_clamp): New.
(es_create): Destroy stream lock on error.
(do_close): Destroy stream lock.

Details

Provenance
wernerAuthored on Aug 25 2014, 4:33 PM
Parents
rE98781deb0b17: Remove GnuPG specific code.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rEfc6516650100: Replace locking code in estream functions. (authored by Werner Koch <wk@gnupg.org>).Aug 25 2014, 4:37 PM