diff options
-rw-r--r-- | ACE/ChangeLog | 21 | ||||
-rwxr-xr-x | ACE/bin/fuzz.pl | 77 |
2 files changed, 96 insertions, 2 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 57a8b8cbb9b..97f9cb2705b 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,20 @@ +Fri Nov 30 23:59:41 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * bin/fuzz.pl: + + Added the following checks: + + check_for_ACE_SYNCH_MUTEX: + This test checks for the use of ACE_SYNCH_MUTEX in TAO/CIAO, + TAO_SYNCH should be used instead for consistency. + + check_for_ACE_Thread_Mutex: + This test checks for the use of ACE_Thread_Mutex in TAO/CIAO, + TAO_SYNCH_MUTEX should be used instead to make the code buid + in single-threaded builds. + + I will fix the resulting fuzz errors over the weekend. + Fri Nov 30 22:11:32 UTC 2007 Steve Huston <shuston@riverace.com> * ace/WFMO_Reactor.h: Clarify that only the owner thread can expire @@ -35,14 +52,14 @@ Fri Nov 30 11:50:00 UTC 2007 Simon Massey <sma@prismtech.com> Thu Nov 29 19:49:23 UTC 2007 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu> - * tests/Process_Manager_Test.cpp: Changed ACE_MT_SYNCH to ACE_SYNCH so + * tests/Process_Manager_Test.cpp: Changed ACE_MT_SYNCH to ACE_SYNCH so this works on single-threaded builds. Thanks to Johnny for reporting this. Thu Nov 29 18:10:27 UTC 2007 J.T. Conklin <jtc@acorntoolworks.com> * ace/ARGV.h: - + #include "ace/Global_Macros.h". This is included implicitly on platforms where ACE_TEMPLATES_REQUIRE_SOURCE, but is needed for those that don't. diff --git a/ACE/bin/fuzz.pl b/ACE/bin/fuzz.pl index 10b159781b1..d797f0810c9 100755 --- a/ACE/bin/fuzz.pl +++ b/ACE/bin/fuzz.pl @@ -287,6 +287,79 @@ sub check_for_noncvs_files () } } +# This test checks for the use of ACE_SYNCH_MUTEX in TAO/CIAO, +# TAO_SYNCH_MUTEX should used instead. + +sub check_for_ACE_SYNCH_MUTEX () +{ + print "Running ACE_SYNCH_MUTEX check\n"; + ITERATION: foreach $file (@files_cpp, @files_inl, @files_h) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + ++$line; + if (/FUZZ\: disable check_for_ACE_SYNCH_MUTEX/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_ACE_SYNCH_MUTEX/) { + $disable = 0; + } + if ($disable == 0 and /ACE_SYNCH_MUTEX/) { + # It is okay to use ACE_SYNCH_MUTEX in ACE + # so don't check the ACE directory + if (($file =~ /ACE/)) { + next ITERATION; + } + + print_error ("$file:$.: found ACE_SYNCH_MUTEX, use TAO_SYNCH_MUTEX instead"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the use of ACE_Thread_Mutex in TAO/CIAO, +# TAO_SYNCH_MUTEX should used instead to make the code build +# in single-threaded builds. + +sub check_for_ACE_Thread_Mutex () +{ + print "Running ACE_Thread_Mutex check\n"; + ITERATION: foreach $file (@files_cpp, @files_inl, @files_h) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + ++$line; + if (/FUZZ\: disable check_for_ACE_Thread_Mutex/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_ACE_Thread_Mutex/) { + $disable = 0; + } + if ($disable == 0 and /ACE_Thread_Mutex/) { + # It is okay to use ACE_Thread_Mutex in ACE + # so don't check the ACE directory + if (($file =~ /ACE/)) { + next ITERATION; + } + + print_error ("$file:$.: found ACE_Thread_Mutex, use TAO_SYNCH_MUTEX instead to allow the code to work in single-threaded builds"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + # This test checks for the use of tabs, spaces should be used instead of tabs sub check_for_tab () { @@ -1681,6 +1754,8 @@ if (!getopts ('cdhl:t:mv') || $opt_h) { check_for_inline_in_cpp check_for_id_string check_for_newline + check_for_ACE_SYNCH_MUTEX + check_for_ACE_Thread_Mutex check_for_tab check_for_exception_spec check_for_NULL @@ -1742,6 +1817,8 @@ check_for_makefile_variable () if ($opt_l >= 1); check_for_inline_in_cpp () if ($opt_l >= 2); check_for_id_string () if ($opt_l >= 1); check_for_newline () if ($opt_l >= 1); +check_for_ACE_Thread_Mutex () if ($opt_l >= 1); +check_for_ACE_SYNCH_MUTEX () if ($opt_l >= 1); check_for_tab () if ($opt_l >= 1); check_for_lack_ACE_OS () if ($opt_l >= 10); check_for_exception_spec () if ($opt_l >= 1); |