Commit Graph

53 Commits

Author SHA1 Message Date
paulc c4c9e994f0 Renamed DebugGoOn to DebugCrit so it better matches its purpose.
Swapped order of DebugCall and DebugNote so DebugCall is less visible.
Changed default debug level to DebugNote.
Modified a few inadequate uses of DebugCrit.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6250 acf43c95-373e-0410-b603-e72c3f656dc1
2017-08-01 13:08:23 +00:00
marian 56d84e6a37 Added accessor for Lockable safety flag.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5941 acf43c95-373e-0410-b603-e72c3f656dc1
2015-02-19 13:53:38 +00:00
marian 988d1af0e4 Semaphore initial count can now be set in constructor.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5939 acf43c95-373e-0410-b603-e72c3f656dc1
2015-02-18 11:36:25 +00:00
paulc 37a72e4bc1 Added copyright notices to sources and scripts missing them.
Updated copyright notices for 2014.
Fixed end of lines in many files.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5755 acf43c95-373e-0410-b603-e72c3f656dc1
2014-02-05 11:42:17 +00:00
paulc cf5d0fd71a Changed license terms in each source file to reference an external file.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5609 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-06 13:38:10 +00:00
paulc 2cf95d0cf8 Return -1 to the Mutex or Semaphore count if they are not counted (started without -Dd).
Don't include them in Engine status if not counted.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5545 acf43c95-373e-0410-b603-e72c3f656dc1
2013-06-14 13:08:30 +00:00
paulc 347829548c Invert the action of -Dd command line option, favor performance by default.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5541 acf43c95-373e-0410-b603-e72c3f656dc1
2013-06-13 09:27:03 +00:00
paulc cd895c0b08 Verify if the mutex unlock fails, abort if configured so.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4958 acf43c95-373e-0410-b603-e72c3f656dc1
2012-03-07 17:03:22 +00:00
paulc 2c1458b67a Removed referencing of mutexes and semaphores while locked or locking.
It is unsafe without the global mutex and was hiding genuine bugs like deleting a locked Mutex.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3805 acf43c95-373e-0410-b603-e72c3f656dc1
2010-11-11 08:29:35 +00:00
paulc 0883e02e29 Added API and -Dd command line parameter to disable taking the global mutex when (un)locking a Mutex or Semaphore.
This provides better performance and reduces mutex contention on expense of some thread safety and ease of debugging.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3801 acf43c95-373e-0410-b603-e72c3f656dc1
2010-11-09 19:52:51 +00:00
marian be61cac29b Added MutexPool class implementing a fixed size array of mutexes. Replaced the global mutex protecting the RefObject counter changes with a mutex pool.
git-svn-id: http://yate.null.ro/svn/yate/trunk@3760 acf43c95-373e-0410-b603-e72c3f656dc1
2010-11-01 14:54:53 +00:00
oana 51b082375f Yate has been ported on Mac OS X.
git-svn-id: http://yate.null.ro/svn/yate/trunk@3153 acf43c95-373e-0410-b603-e72c3f656dc1
2010-03-30 11:49:43 +00:00
paulc 8ed8bd3095 Added method to retrieve the name of the Thread currently owning a Mutex.
git-svn-id: http://yate.null.ro/svn/yate/trunk@3022 acf43c95-373e-0410-b603-e72c3f656dc1
2010-01-16 20:42:25 +00:00
paulc 966a1201b9 Added possibility to repeat the -Dm option to halve the mutex maximum wait time.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2982 acf43c95-373e-0410-b603-e72c3f656dc1
2009-12-10 11:20:50 +00:00
paulc 5e9911c6e6 For debugging purposes added a count of threads trying to lock a mutex, display number of waiting threads in failure messages.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2798 acf43c95-373e-0410-b603-e72c3f656dc1
2009-08-19 16:27:48 +00:00
paulc 16c5905559 Fixed the reference counting of Semaphore internal implementation.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2796 acf43c95-373e-0410-b603-e72c3f656dc1
2009-08-18 15:32:06 +00:00
paulc ebd41dfaec Use the platform idle time in various sleeps in SIP and Jabber.
Fixed a compiler warning about the copy constructor of Mutex and 
Semaphore.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2763 acf43c95-373e-0410-b603-e72c3f656dc1
2009-07-22 15:41:28 +00:00
paulc 132976a3ef Include <time.h> as on some platforms is required for struct timespec.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2762 acf43c95-373e-0410-b603-e72c3f656dc1
2009-07-22 13:09:21 +00:00
paulc a2812051f2 Added Semaphore class, made Mutex derive from (new class) Lockable, made Lock able to get a lock on any Lockable - Mutex or Semaphore.
Use pthread_mutex_timedlock and sem_timedwait if available on platform.
Fixed a bug in the IAX channel exposed by Mutex having virtual methods.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2761 acf43c95-373e-0410-b603-e72c3f656dc1
2009-07-22 12:57:14 +00:00
paulc 46761a8933 Fixed build on Windows, MUTEX_STATIC_UNSAFE handling must be outside the platform specific ifdef.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2732 acf43c95-373e-0410-b603-e72c3f656dc1
2009-06-22 13:20:09 +00:00
paulc a6a9d71e8f Allow skipping mutex operations until main() on platforms where mutexes
are unsafe in global object constructors.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2721 acf43c95-373e-0410-b603-e72c3f656dc1
2009-06-18 12:21:23 +00:00
paulc 85da36395b Added names to the Mutex class to ease debugging of deadlocks.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2611 acf43c95-373e-0410-b603-e72c3f656dc1
2009-05-05 12:25:31 +00:00
paulc 90711d6097 Fixed deadlock when mutex lock count is negative so it aborts out properly.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2287 acf43c95-373e-0410-b603-e72c3f656dc1
2008-10-24 13:46:17 +00:00
paulc e78154d454 Do not exit a soft cancelled thread while trying to acquire a mutex.
Immediately fail the wait of a non mandatory locking if thread is cancelled.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2230 acf43c95-373e-0410-b603-e72c3f656dc1
2008-09-20 10:12:00 +00:00
paulc d1b55ca3e7 Abort immediately on highly critical errors even if not requested from command line.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2043 acf43c95-373e-0410-b603-e72c3f656dc1
2008-07-01 14:57:43 +00:00
paulc 3c32ca4eb8 Check that mutex is unlocked from the right thread.
git-svn-id: http://yate.null.ro/svn/yate/trunk@1832 acf43c95-373e-0410-b603-e72c3f656dc1
2008-03-21 15:46:04 +00:00
paulc 9d6e4c5b4b Added more warnings for abnormal conditions.
git-svn-id: http://yate.null.ro/svn/yate/trunk@1831 acf43c95-373e-0410-b603-e72c3f656dc1
2008-03-21 15:25:10 +00:00
paulc bc7555cdb5 Made some local variables static.
git-svn-id: http://yate.null.ro/svn/yate/trunk@851 acf43c95-373e-0410-b603-e72c3f656dc1
2006-06-10 12:05:16 +00:00
paulc cda2d9f1c2 Updated copyright and FSF address.
git-svn-id: http://yate.null.ro/svn/yate/trunk@815 acf43c95-373e-0410-b603-e72c3f656dc1
2006-05-27 15:08:43 +00:00
paulc 5f972a465c Worked around a bug in older libpthread - waking up a canceled thread that
was trying to lock a mutex.


git-svn-id: http://yate.null.ro/svn/yate/trunk@682 acf43c95-373e-0410-b603-e72c3f656dc1
2006-02-09 18:49:44 +00:00
paulc 8faacfe499 Fixed a nasty bug in Linux TLS initialization.
Improved thread/mutex debugging.


git-svn-id: http://yate.null.ro/svn/yate/trunk@652 acf43c95-373e-0410-b603-e72c3f656dc1
2006-01-18 18:28:28 +00:00
paulc 739bed212b Refactored locking and list iteration to solve deadlocks and race conditions.
git-svn-id: http://yate.null.ro/svn/yate/trunk@639 acf43c95-373e-0410-b603-e72c3f656dc1
2006-01-12 05:32:06 +00:00
paulc 9b0a4adf0c Fixed IAX, H.323, ISDN and CDR to include caller/called and time in msec.
Fixed a bug in H.323 connection cleanup.
Some patches for FreeBSD compatibility.


git-svn-id: http://yate.null.ro/svn/yate/trunk@553 acf43c95-373e-0410-b603-e72c3f656dc1
2005-10-30 04:03:25 +00:00
paulc 215cd75a24 Mutex related changes in engine and channels.
git-svn-id: http://yate.null.ro/svn/yate/trunk@467 acf43c95-373e-0410-b603-e72c3f656dc1
2005-08-02 02:20:00 +00:00
paulc aac002b4f0 Decreased maximum mutex wait argument (maxwait) to long - 2400 seconds should be enough and this will increase performance and gdb's ability to show it.
git-svn-id: http://yate.null.ro/svn/yate/trunk@466 acf43c95-373e-0410-b603-e72c3f656dc1
2005-07-30 11:02:19 +00:00
paulc b52a90a618 Updated copyright years, fixed %ll formatting.
git-svn-id: http://yate.null.ro/svn/yate/trunk@320 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-29 22:05:07 +00:00
paulc 9459c52dcd *** empty log message ***
git-svn-id: http://yate.null.ro/svn/yate/trunk@284 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-10 21:52:31 +00:00
paulc d35d4d6b4a Separated non-engine related classes in their own include file.
git-svn-id: http://yate.null.ro/svn/yate/trunk@279 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-08 10:55:22 +00:00
paulc 60ec9fec0b Added VC++6 projects and lots of porting changes
git-svn-id: http://yate.null.ro/svn/yate/trunk@272 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-02 00:49:38 +00:00
paulc e14d74a073 *** empty log message ***
git-svn-id: http://yate.null.ro/svn/yate/trunk@265 acf43c95-373e-0410-b603-e72c3f656dc1
2005-03-28 00:58:26 +00:00
paulc 61d3b640b0 Added Channel and Driver classes, beautified source a little.
git-svn-id: http://yate.null.ro/svn/yate/trunk@263 acf43c95-373e-0410-b603-e72c3f656dc1
2005-03-20 03:11:53 +00:00
paulc 8123c918b2 Moved the engine away, added install-noapi
git-svn-id: http://yate.null.ro/svn/yate/trunk@260 acf43c95-373e-0410-b603-e72c3f656dc1
2005-03-18 18:16:59 +00:00
paulc 9ed8a01410 Added fast locked() method to check if a mutex is held.
git-svn-id: http://yate.null.ro/svn/yate/trunk@250 acf43c95-373e-0410-b603-e72c3f656dc1
2005-02-28 08:25:41 +00:00
paulc e836270e9a Added recursive mitex support - tey were needed...
git-svn-id: http://yate.null.ro/svn/yate/trunk@213 acf43c95-373e-0410-b603-e72c3f656dc1
2005-01-17 16:05:14 +00:00
paulc e7442cac81 Hack to compile on systems that have but don't declare pthread_mutexattr_settype.
git-svn-id: http://yate.null.ro/svn/yate/trunk@135 acf43c95-373e-0410-b603-e72c3f656dc1
2004-12-21 14:06:25 +00:00
paulc 7fafda0323 Many stability improvments.
git-svn-id: http://yate.null.ro/svn/yate/trunk@132 acf43c95-373e-0410-b603-e72c3f656dc1
2004-12-20 04:11:29 +00:00
paulc 656e423474 Added copyright notice.
git-svn-id: http://yate.null.ro/svn/yate/trunk@114 acf43c95-373e-0410-b603-e72c3f656dc1
2004-11-29 03:56:41 +00:00
paulc d7820fc1f1 Lots of thread interlocking fixes, extra H.323 options for inband DTMF and
silence detection suppression.


git-svn-id: http://yate.null.ro/svn/yate/trunk@95 acf43c95-373e-0410-b603-e72c3f656dc1
2004-10-24 21:35:54 +00:00
paulc 260fc92b9d Added global mutex to protect other mutexes' data structures.
git-svn-id: http://yate.null.ro/svn/yate/trunk@82 acf43c95-373e-0410-b603-e72c3f656dc1
2004-10-14 17:27:03 +00:00
paulc 788c1733cc Reordered instructions to trap problems.
git-svn-id: http://yate.null.ro/svn/yate/trunk@81 acf43c95-373e-0410-b603-e72c3f656dc1
2004-10-14 16:56:57 +00:00