summaryrefslogtreecommitdiffstats
path: root/lib/qpthreads.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixes to compile on FreeBSD 8.0 with gcc 4.2.1Chris Hall2010-04-161-3/+3
|
* Add qpthreads_thread_created to lib/qpthreadsChris Hall2010-01-051-1/+3
| | | | | Flag indicates that at least one thread has been created. (To be used to ensure no surprises when daemonising !)
* Initial commit for bgp_engine branch -- seeding new files...Chris Hall2010-01-041-9/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On branch bgp_engine modified: .gitignore modified: bgpd/Makefile.am new file: bgpd/bgp.h new file: bgpd/bgp_common.c new file: bgpd/bgp_common.h new file: bgpd/bgp_connection.c new file: bgpd/bgp_connection.h modified: bgpd/bgp_debug.c new file: bgpd/bgp_engine.c new file: bgpd/bgp_engine.h modified: bgpd/bgp_fsm.c modified: bgpd/bgp_fsm.h modified: bgpd/bgp_network.c modified: bgpd/bgp_network.h new file: bgpd/bgp_notification.c new file: bgpd/bgp_notification.h modified: bgpd/bgp_open.c new file: bgpd/bgp_open_state.c new file: bgpd/bgp_open_state.h modified: bgpd/bgp_packet.c new file: bgpd/bgp_peer.c new file: bgpd/bgp_peer.h modified: bgpd/bgp_route.c new file: bgpd/bgp_session.c new file: bgpd/bgp_session.h modified: bgpd/bgp_vty.c modified: bgpd/bgp_zebra.c modified: bgpd/bgpd.c modified: bgpd/bgpd.h modified: lib/Makefile.am modified: lib/memtypes.c modified: lib/mqueue.c modified: lib/mqueue.h new file: lib/qafi_safi.h modified: lib/qpselect.c modified: lib/qpselect.h modified: lib/qpthreads.c modified: lib/qpthreads.h modified: lib/sockopt.c modified: lib/sockunion.c modified: lib/sockunion.h modified: lib/stream.c modified: lib/stream.h modified: lib/symtab.h modified: lib/zebra.h
* Add qpt_thread_join() to lib/qpthreadsChris Hall (GMCH)2009-12-171-0/+28
|
* Introduced qpthreads_enabled flag in lib/qpthreadsChris Hall (GMCH)2009-12-101-43/+186
| | | | | | This supports running without pthreads, but with code that is made thread-safe. A Big Switch -- qpthreads_enabled -- enables or disables all pthread functions. When disabled, all mutex calls become NOPs.
* Ensure all timeouts are timeout times in qtime_mono_t.Chris Hall (GMCH)2009-12-091-9/+31
| | | | | | | | | | | | | | | | | | Introduced separate types for qtime_mono_t and qtime_real_t, to distinguish the time base of a given value. Revised all users of timeouts so that they are all expressed as qtime_mono_t values, so are all Quagga monotonic time based. Revised qpt_cond_timedwait() so that all condition variables use the same timebase (CLOCK_MONOTONIC if available, by default). Now all timeout times are qtime_mono_t, and are converted to whatever the condition variable is set to, if necessary. Added explicit timeout to mqueue. Fixed qps_pselect() to zeroise result vectors if no fds are reported pending -- seems the O/S does not do this.
* Enabled qpt_mutex_recursive in lib/qpthreads.Chris Hall (GMCH)2009-12-071-0/+64
| | | | | | | | | This allows mutexes to be initialised as recursive. Required correctly placed setting of _GNU_SOURCE (for gcc). It is assumed that "config.h" will enable the required pthreads features -- which are now documented in lib/qpthread.c.
* Updates to lib/qpthreads.c & .hChris Hall (GMCH)2009-12-061-0/+3
| | | | | | Added qpt_thread_self(). Initialised output sigset_t before setting it in qpt_thread_sigmask().
* Add signal functions to lib/qpthreads.cChris Hall (GMCH)2009-12-031-0/+46
| | | | Adding qpt_thread_sigmask() and qpt_thread_signal().
* Pthreads infrastructure -- initial commitChris Hall (GMCH)2009-12-021-0/+435
New files: lib/qpthreads.c & .h Encapsulates the Pthreads facilities to be used in Quagga. Implicitly documents the sub-set of Pthreads being used. Provides error checking for a number of functions which may return errors, but are not generally expected to and for whom an error is treated as fatal. Could be modified to "null out" the use of Pthreads. New files: lib/qtime.c & .h Defines a 64-bit integer time value which is a lot easier to handle than the usual timespec and timeval structures. (C99 requires a 64-bit integer.) Provides front ends for gettimeofday() & clock_gettime() which return 64-bit time value. Also conversions to and from timespec and timeval. Provides a monotonic clock for when CLOCK_MONOTONIC is not available. (This is based on code from Joakim Tjernlund.) New files: lib/heap.c & .h Implements a heap data structure closely allied to the vector. This will be used for timer handling. Modified: lib/memtypes.c New memory types for qpthreads structures and for the heap. Modified: lib/zassert.h Added explicit "passert" == assert which is not subject to NDEBUG. Added explicit "nassert" == assert which is subject to NDEBUG. Added zabort, zabort_errno and zabbort_err for when something has gone fatally wrong. (Require changes to lib/log.c which are TBD.)