aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/lock.h
AgeCommit message (Collapse)AuthorFilesLines
2009-04-23Merge of timedwrlock detection broke build.tilghman1-4/+4
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@190419 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-22Merged revisions 190093 via svnmerge from tilghman1-4/+75
https://origsvn.digium.com/svn/asterisk/trunk ................ r190093 | tilghman | 2009-04-22 16:38:15 -0500 (Wed, 22 Apr 2009) | 14 lines Merged revisions 190092 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r190092 | tilghman | 2009-04-22 16:35:03 -0500 (Wed, 22 Apr 2009) | 7 lines Detect availability of pthread_rwlock_timedwrlock() before using it. (closes issue #14930) Reported by: tilghman Patches: 20090420__bug14930.diff.txt uploaded by tilghman (license 14) Tested by: mvanbaak, tilghman ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@190094 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09typotilghman1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@187490 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09Merged revisions 187483 via svnmerge from tilghman1-0/+71
https://origsvn.digium.com/svn/asterisk/trunk ................ r187483 | tilghman | 2009-04-09 13:40:01 -0500 (Thu, 09 Apr 2009) | 15 lines Merged revisions 187428 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r187428 | tilghman | 2009-04-09 13:08:20 -0500 (Thu, 09 Apr 2009) | 8 lines Race condition between ast_cli_command() and 'module unload' could cause a deadlock. Add lock timeouts to avoid this potential deadlock. (closes issue #14705) Reported by: jamessan Patches: 20090320__bug14705.diff.txt uploaded by tilghman (license 14) Tested by: jamessan ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@187485 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-30Merged revisions 126574 via svnmerge from russell1-4/+4
https://origsvn.digium.com/svn/asterisk/trunk ................ r126574 | russell | 2008-06-30 11:07:25 -0500 (Mon, 30 Jun 2008) | 18 lines Merged revisions 126573 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r126573 | russell | 2008-06-30 11:05:08 -0500 (Mon, 30 Jun 2008) | 10 lines Fix a typo in the non-DEBUG_THREADS version of the recently added DEADLOCK_AVOIDANCE() macro. This caused the lock to not actually be released, and as a result, not avoid deadlocks at all. This resolves the issues reported in the last while about Asterisk locking up all over the place (and most commonly, in chan_iax2). (closes issue #12927) (closes issue #12940) (closes issue #12925) (potentially closes others ...) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@126575 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-27Merged revisions 125794 via svnmerge from tilghman1-6/+6
https://origsvn.digium.com/svn/asterisk/trunk ................ r125794 | tilghman | 2008-06-27 08:54:13 -0500 (Fri, 27 Jun 2008) | 10 lines Merged revisions 125793 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r125793 | tilghman | 2008-06-27 08:45:03 -0500 (Fri, 27 Jun 2008) | 2 lines In this debugging function, copy to a buffer instead of using potentially unsafe pointers. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@125795 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-25Merged revisions 124966 via svnmerge from tilghman1-0/+19
https://origsvn.digium.com/svn/asterisk/trunk ................ r124966 | tilghman | 2008-06-24 20:08:37 -0500 (Tue, 24 Jun 2008) | 15 lines Merged revisions 124965 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r124965 | tilghman | 2008-06-24 19:46:24 -0500 (Tue, 24 Jun 2008) | 7 lines Pvt deadlock causes some channels to get stuck in Reserved status. (closes issue #12621) Reported by: fabianoheringer Patches: 20080612__bug12621.diff.txt uploaded by Corydon76 (license 14) Tested by: fabianoheringer ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@124967 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-29Merged revisions 118955,118957 via svnmerge from tilghman1-0/+37
https://origsvn.digium.com/svn/asterisk/trunk ................ r118955 | tilghman | 2008-05-29 12:35:19 -0500 (Thu, 29 May 2008) | 11 lines Merged revisions 118953 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r118953 | tilghman | 2008-05-29 12:20:16 -0500 (Thu, 29 May 2008) | 3 lines Add some debugging code that ensures that when we do deadlock avoidance, we don't lose the information about how a lock was originally acquired. ........ ................ r118957 | tilghman | 2008-05-29 12:39:50 -0500 (Thu, 29 May 2008) | 10 lines Merged revisions 118954 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r118954 | tilghman | 2008-05-29 12:33:01 -0500 (Thu, 29 May 2008) | 2 lines Define also when not DEBUG_THREADS ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@118958 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-13Merged revisions 116089 via svnmerge from mmichelson1-3/+6
https://origsvn.digium.com/svn/asterisk/trunk ................ r116089 | mmichelson | 2008-05-13 18:54:01 -0500 (Tue, 13 May 2008) | 20 lines Merged revisions 116088 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r116088 | mmichelson | 2008-05-13 18:47:49 -0500 (Tue, 13 May 2008) | 12 lines A change to the way channel locks are handled when DEBUG_CHANNEL_LOCKS is defined. After debugging a deadlock, it was noticed that when DEBUG_CHANNEL_LOCKS is enabled in menuselect, the actual origin of channel locks is obscured by the fact that all channel locks appear to happen in the function ast_channel_lock(). This code change redefines ast_channel_lock to be a macro which maps to __ast_channel_lock(), which then relays the proper file name, line number, and function name information to the core lock functions so that this information will be displayed in the case that there is some sort of locking error or core show locks is issued. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@116096 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-10Merged revisions 114052 via svnmerge from mmichelson1-0/+17
https://origsvn.digium.com/svn/asterisk/trunk ................ r114052 | mmichelson | 2008-04-10 17:02:32 -0500 (Thu, 10 Apr 2008) | 11 lines Merged revisions 114051 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114051 | mmichelson | 2008-04-10 15:59:49 -0500 (Thu, 10 Apr 2008) | 3 lines Fix 1.4 build when LOW_MEMORY is enabled. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@114056 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-28Merged revisions 105116 via svnmerge from russell1-9/+9
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r105116 | russell | 2008-02-28 16:23:05 -0600 (Thu, 28 Feb 2008) | 8 lines Fix a bug in the lock tracking code that was discovered by mmichelson. The issue is that if the lock history array was full, then the functions to mark a lock as acquired or not would adjust the stats for whatever lock is at the end of the array, which may not be itself. So, do a sanity check to make sure that we're updating lock info for the proper lock. (This explains the bizarre stats on lock #63 in BE-396, thanks Mark!) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105144 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-14Merged revisions 92875 via svnmerge from mmichelson1-4/+5
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r92875 | mmichelson | 2007-12-13 19:24:06 -0600 (Thu, 13 Dec 2007) | 7 lines When compiling with DETECT_DEADLOCKS, don't spam the CLI with messages about possible deadlocks. Instead just print the intended single message every five seconds. (closes issue 11537, reported and patched by dimas) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92876 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07Merged revisions 91828 via svnmerge from russell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r91828 | russell | 2007-12-07 15:17:24 -0600 (Fri, 07 Dec 2007) | 6 lines Fix another bug in the DEBUG_THREADS code. The ast_mutex_init() function had the mutex attribute object marked as static. This means that multiple threads initializing locks at the same time could step on each other and end up with improperly initialized locks. (found when tracking down locking issues related to issue #11080) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91829 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07Merged revisions 91826 via svnmerge from russell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r91826 | russell | 2007-12-07 15:11:08 -0600 (Fri, 07 Dec 2007) | 6 lines I love fixing lock related errors in the lock debugging code. That's about as ironic as it gets in Asterisk programming land. Anyway, I spotted this bug while trying to track down why systems are locking up and acting weird in issue #11080. The mutex attribute object was marked as static in this function when it should not have been. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91827 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-05Merged revisions 91070 via svnmerge from russell1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r91070 | russell | 2007-12-04 18:35:31 -0600 (Tue, 04 Dec 2007) | 11 lines Fix some crashes in chan_iax2 that were reported as happening on Mac systems. It turns out that the problem was the Mac version of the ast_atomic_fetchadd_int() function. The Mac atomic add function returns the _new_ value, while this function is supposed to return the old value. So, the crashes happened on unreferencing objects. If the reference count was decreased to 1, ao2_ref() thought that it had been decreased to zero, and called the destructor. However, there was still an outstanding reference around. (closes issue #11176) (closes issue #11289) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91114 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-29Fix build of trunktilghman1-0/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@90157 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-19move the declaration of struct ast_channel ast_frame and ast_modulerizzo1-2/+0
to compat.h so it is always available - hopefully this will let us reduce the number of inclusions of channel.h and frame.h git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89426 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-17Use autoconf logic to determine the presence of ↵file1-1/+1
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP and PTHREAD_MUTEX_RECURSIVE_NP. Enclose error message from network.h in " git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89394 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-17compatibility fixes for cygwinrizzo1-2/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89371 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16whitespace only change - adjust indentation and add somerizzo1-73/+83
comments on the content of these two files. utils.h (which is included in over 150 files) contains a lot of unrelated functions which require the inclusion of a large number of other headers. At some point we should partition its content in a better way. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89341 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16Start untangling header inclusion in a way that does not affectrizzo1-4/+1
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-15access channel locks through ast_channel_lock/unlock/trylock and notrizzo1-3/+3
through ast_mutex primitives. To detect all occurrences, I have renamed the lock field in struct ast_channel so it is clear that it shouldn't be used directly. There are some uses in res/res_features.c (see details of the diff) that are error prone as they try and lock two channels without caring about the order (or without explaining why it is safe). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89293 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-13This fixes a build error on my mac. It also works on my linux box. Let merussell1-1/+1
know if it breaks any other platform ... git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89253 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-06Merged revisions 89045 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89045 | tilghman | 2007-11-06 13:09:06 -0600 (Tue, 06 Nov 2007) | 2 lines We went to the trouble of creating a method of tracking failed trylocks, then never turned it on (oops). ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89049 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-06Merged revisions 88931 via svnmerge from russell1-67/+0
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r88931 | russell | 2007-11-06 07:50:15 -0600 (Tue, 06 Nov 2007) | 8 lines Remove some checks to see if locks are initialized from the non-DEBUG_THREADS versions of the lock routines. These are incorrect for a number of reasons: - It breaks the build on mac. - If there is a problem with locks not getting initialized, then the proper fix is to find that place and fix the code so that it does get initialized. - If additional debug code is needed to help find the problem areas, then this type of things should _only_ be put in the DEBUG_THREADS wrappers. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88932 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-02Merged revisions 88210 via svnmerge from tilghman1-29/+29
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r88210 | tilghman | 2007-11-02 08:03:03 -0500 (Fri, 02 Nov 2007) | 5 lines Fix build on Solaris Reported by: snuffy Patch by: ys Closes issue #11143 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88211 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-30Merged revisions 87739 via svnmerge from tilghman1-67/+298
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87739 | tilghman | 2007-10-30 18:02:22 -0500 (Tue, 30 Oct 2007) | 5 lines Fix for uninitialized mutexes on *BSD Reported by: ys Fixed by: ys Closes issue #11116 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87740 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-29Merged revisions 87396 via svnmerge from russell1-24/+24
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87396 | russell | 2007-10-29 15:22:07 -0500 (Mon, 29 Oct 2007) | 5 lines Add some more details to the output of "core show locks". When a thread is waiting for a lock, this will now show the details about who currently has it locked. (inspired by issue #11100) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87397 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-22Merged revisions 86836 via svnmerge from russell1-4/+19
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r86836 | russell | 2007-10-22 16:36:12 -0500 (Mon, 22 Oct 2007) | 9 lines If lock tracking is not enabled, then we can not attempt to log any mutex failures. If so, we could end up in infinite recursion. The only lock that is affected by this is a mutex in astmm.c used when MALLOC_DEBUG is enabled. (closes issue #11044) Reported by: ys Patches: lock.h.diff uploaded by ys (license 281) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86839 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-22Merged revisions 86726 via svnmerge from russell1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r86726 | russell | 2007-10-22 10:43:30 -0500 (Mon, 22 Oct 2007) | 4 lines Update the static mutex initializer to include the initialization of the internal mutex used to protect the lock debugging data. (closes issue #11044, patch suggested by Ivan) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86734 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-16Merged revisions 85997 via svnmerge from russell1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85997 | russell | 2007-10-16 17:36:16 -0500 (Tue, 16 Oct 2007) | 1 line really picky formatting tweak ... ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85998 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-16Merged revisions 85994 via svnmerge from russell1-19/+71
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85994 | russell | 2007-10-16 17:14:36 -0500 (Tue, 16 Oct 2007) | 16 lines Some locking errors exposed the fact that the lock debugging code itself was not thread safe. How ironic! Anyway, these changes ensure that the code that is accessing the lock debugging data is thread-safe. Many thanks to Ivan for finding and fixing the core issue here, and also thanks to those that tested the patch and provided test results. (closes issue #10571) (closes issue #10886) (closes issue #10875) (might close some others, as well ...) Patches: (from issue #10571) ivan_ast_1_4_12_rel_patch_lock.h.diff uploaded by Ivan (license 229) - a few small changes by me ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85995 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-09Merged revisions 85158 via svnmerge from tilghman1-4/+12
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85158 | tilghman | 2007-10-09 16:55:06 -0500 (Tue, 09 Oct 2007) | 5 lines This commit fixes the following issues: - Deadlock in ast_write (issue #10406) - Deadlock in ast_read (issue #10406) - Possible mutex initialization error in lock.h (issue #10571) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85176 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01Merged revisions 84271 via svnmerge from russell1-10/+17
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84271 | russell | 2007-10-01 16:07:06 -0500 (Mon, 01 Oct 2007) | 4 lines Fulfull a feature request from Qwell on the "core show locks" output. It will now note the lock type for each lock that a thread holds. (mutex, rdlock, or wrlock) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84272 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01Merged revisions 84206 via svnmerge from russell1-0/+79
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84206 | russell | 2007-10-01 14:34:12 -0500 (Mon, 01 Oct 2007) | 2 lines Show rwlocks in the "core show locks" output. Before, it only showed mutexes. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84207 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-09Merged revisions 82028 via svnmerge from tilghman1-3/+11
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82028 | tilghman | 2007-09-08 21:35:18 -0500 (Sat, 08 Sep 2007) | 2 lines Fix inline compiles on really old compilers (who uses gcc 2.7 anymore, really?) (closes issue #10675) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82029 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-05Merged revisions 81569 via svnmerge from tilghman1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r81569 | tilghman | 2007-09-05 12:18:24 -0500 (Wed, 05 Sep 2007) | 2 lines Solaris x86 compatibility fix ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81631 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-20Stephn Davies reports that this will help make things work on 64-bit machinesmurf1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80075 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-10Merged revisions 78995 via svnmerge from russell1-9/+17
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78995 | russell | 2007-08-10 10:20:09 -0500 (Fri, 10 Aug 2007) | 4 lines The last set of changes that I made to "core show locks" made it not able to track mutexes unless they were declared using AST_MUTEX_DEFINE_STATIC. Locks initialized with ast_mutex_init() were not tracked. It should work now. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79005 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-05Merged revisions 78143 via svnmerge from russell1-0/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78143 | russell | 2007-08-04 23:15:31 -0500 (Sat, 04 Aug 2007) | 2 lines Fix compilation failure when MALLOC_DEBUG is enabled, but DEBUG_THREADS is not ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@78144 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-03Merged revisions 78095 via svnmerge from russell1-6/+64
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78095 | russell | 2007-08-03 14:39:49 -0500 (Fri, 03 Aug 2007) | 28 lines Add some improvements to lock debugging. These changes take effect with DEBUG_THREADS enabled and provide the following: * This will keep track of which locks are held by which thread as well as which lock a thread is waiting for in a thread-local data structure. A reference to this structure is available on the stack in the dummy_start() function, which is the common entry point for all threads. This information can be easily retrieved using gdb if you switch to the dummy_start() stack frame of any thread and print the contents of the lock_info variable. * All of the thread-local structures for keeping track of this lock information are also stored in a list so that the information can be dumped to the CLI using the "core show locks" CLI command. This introduces a little bit of a performance hit as it requires additional underlying locking operations inside of every lock/unlock on an ast_mutex. However, the benefits of having this information available at the CLI is huge, especially considering this is only done in DEBUG_THREADS mode. It means that in most cases where we debug deadlocks, we no longer have to request access to the machine to analyze the contents of ast_mutex_t structures. We can now just ask them to get the output of "core show locks", which gives us all of the information we needed in most cases. I also had to make some additional changes to astmm.c to make this work when both MALLOC_DEBUG and DEBUG_THREADS are enabled. I disabled tracking of one of the locks in astmm.c because it gets used inside the replacement memory allocation routines, and the lock tracking code allocates memory. This caused infinite recursion. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@78096 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-24Merged revisions 76937 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r76937 | tilghman | 2007-07-24 17:12:43 -0500 (Tue, 24 Jul 2007) | 10 lines Merged revisions 76934 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r76934 | tilghman | 2007-07-24 17:11:33 -0500 (Tue, 24 Jul 2007) | 2 lines Oops, res contains the error code, not errno. I was wondering why a mutex was reporting "No such file or directory"... ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@76940 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-28Remove a message that goes to LOG_ERROR that's not really an error.russell1-3/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@62264 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-08Change trylock output for what already has the lock from an error to a warning.file1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@50034 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-23We should probably declare the lock... and not just the ↵file1-0/+1
constructor/deconstructor. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48928 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-23Use the correct function to destroy an rwlock in the destructor for an ↵russell1-1/+1
ast_rwlock_t git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48927 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-15Add support to see what holds the lock when doing trylock.file1-1/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48480 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-02Set the AST_RWLOCK_INIT_VALUE to the PTHREAD_RWLOCK_INIT_VALUE if it is ↵file1-0/+1
available, that way outside stuff can determine whether to use a constructor or deconstructor for initialization instead of using the init value. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@46940 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-02I'm crazy so I will add this... pthread rwlock wrappers, along with autoconf ↵file1-0/+64
stuff that detects the presence of the initializer and the ability to set the kind of lock (in our case we rather like writer preferred locks so writer starvation doesn't occur... but on something like Darwin we don't get that) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@46935 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-30Issue 8246 Doxygen updates (kshumard) oej1-1/+1
THANK YOU! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@46434 f38db490-d61c-443f-a65b-d21fe96a405b