diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/all.dsw | 39 | ||||
-rw-r--r-- | cpp/demo/Freeze/bench/Client.cpp | 2 | ||||
-rw-r--r-- | cpp/demo/Freeze/bench/Makefile | 12 | ||||
-rw-r--r-- | cpp/demo/Freeze/bench/bench.dsp | 179 | ||||
-rw-r--r-- | cpp/include/IceUtil/Cond.h | 98 | ||||
-rw-r--r-- | cpp/src/IceUtil/Cond.cpp | 82 |
6 files changed, 300 insertions, 112 deletions
diff --git a/cpp/all.dsw b/cpp/all.dsw index a3d7858c919..b922f190a78 100644 --- a/cpp/all.dsw +++ b/cpp/all.dsw @@ -20,9 +20,6 @@ Package=<4> Begin Project Dependency
Project_Dep_Name slice2freeze
End Project Dependency
- Begin Project Dependency
- Project_Dep_Name IceXML
- End Project Dependency
}}}
###############################################################################
@@ -486,6 +483,27 @@ Package=<4> ###############################################################################
+Project: "bench"=.\demo\Freeze\bench\bench.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name Freeze
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name Ice
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name IceUtil
+ End Project Dependency
+}}}
+
+###############################################################################
+
Project: "callbackC"=.\demo\Ice\callback\callbackC.dsp - Package Owner=<4>
Package=<5>
@@ -581,9 +599,6 @@ Package=<4> Begin Project Dependency
Project_Dep_Name IceUtil
End Project Dependency
- Begin Project Dependency
- Project_Dep_Name IceXML
- End Project Dependency
}}}
###############################################################################
@@ -626,9 +641,6 @@ Package=<4> Begin Project Dependency
Project_Dep_Name IceUtil
End Project Dependency
- Begin Project Dependency
- Project_Dep_Name IceXML
- End Project Dependency
}}}
###############################################################################
@@ -1178,9 +1190,6 @@ Package=<4> Begin Project Dependency
Project_Dep_Name IceUtil
End Project Dependency
- Begin Project Dependency
- Project_Dep_Name IceXML
- End Project Dependency
}}}
###############################################################################
@@ -1202,9 +1211,6 @@ Package=<4> Begin Project Dependency
Project_Dep_Name IceUtil
End Project Dependency
- Begin Project Dependency
- Project_Dep_Name IceXML
- End Project Dependency
}}}
###############################################################################
@@ -1226,9 +1232,6 @@ Package=<4> Begin Project Dependency
Project_Dep_Name IceUtil
End Project Dependency
- Begin Project Dependency
- Project_Dep_Name IceXML
- End Project Dependency
}}}
###############################################################################
diff --git a/cpp/demo/Freeze/bench/Client.cpp b/cpp/demo/Freeze/bench/Client.cpp index 7f807a978e7..3ba9d6d4b7f 100644 --- a/cpp/demo/Freeze/bench/Client.cpp +++ b/cpp/demo/Freeze/bench/Client.cpp @@ -16,7 +16,7 @@ # include <sys/time.h> #endif -#include <IntIntMap.h> +#include <BenchTypes.h> using namespace std; diff --git a/cpp/demo/Freeze/bench/Makefile b/cpp/demo/Freeze/bench/Makefile index a1cf82d21c2..de854c41633 100644 --- a/cpp/demo/Freeze/bench/Makefile +++ b/cpp/demo/Freeze/bench/Makefile @@ -14,7 +14,7 @@ CLIENT = client TARGETS = $(CLIENT) $(SERVER) $(COLLOCATED) -OBJS = Client.o IntIntMap.o Test.o +OBJS = Client.o BenchTypes.o Test.o SRCS = $(OBJS:.o=.cpp) @@ -34,13 +34,13 @@ Test.h Test.cpp: Test.ice $(SLICE2CPP) clean:: rm -f Test.h Test.cpp -IntIntMap.h IntIntMap.cpp: Test.ice $(SLICE2FREEZE) - rm -f IntIntMap.h IntIntMap.cpp - $(SLICE2FREEZE) -I$(slicedir) --dict IntIntMap,int,int --dict Struct1Struct2Map,Struct1,Struct2 \ +BenchTypes.h BenchTypes.cpp: Test.ice $(SLICE2FREEZE) + rm -f BenchTypes.h BenchTypes.cpp + $(SLICE2FREEZE) -I$(slicedir) --dict BenchTypes,int,int --dict Struct1Struct2Map,Struct1,Struct2 \ --dict Struct1Class1Map,Struct1,Class1 \ - --dict Struct1ObjectMap,Struct1,Object IntIntMap Test.ice + --dict Struct1ObjectMap,Struct1,Object BenchTypes Test.ice clean:: - rm -f IntIntMap.h IntIntMap.cpp + rm -f BenchTypes.h BenchTypes.cpp include .depend diff --git a/cpp/demo/Freeze/bench/bench.dsp b/cpp/demo/Freeze/bench/bench.dsp new file mode 100644 index 00000000000..95d83bb8893 --- /dev/null +++ b/cpp/demo/Freeze/bench/bench.dsp @@ -0,0 +1,179 @@ +# Microsoft Developer Studio Project File - Name="bench" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=bench - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "bench.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "bench.mak" CFG="bench - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "bench - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "bench - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "bench - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I "." /I "../../../include" /I "dummyinclude" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_UNICODE" /YX /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"client.exe" /libpath:"../../../lib"
+# SUBTRACT LINK32 /debug /nodefaultlib
+
+!ELSEIF "$(CFG)" == "bench - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "dummyinclude" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_UNICODE" /YX /FD /GZ /c
+# SUBTRACT CPP /Fr
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"client.exe" /pdbtype:sept /libpath:"../../../lib"
+# SUBTRACT LINK32 /nodefaultlib
+
+!ENDIF
+
+# Begin Target
+
+# Name "bench - Win32 Release"
+# Name "bench - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\BenchTypes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Test.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\BenchTypes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Test.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Test.ice
+
+!IF "$(CFG)" == "bench - Win32 Release"
+
+USERDEP__TEST_="..\..\..\bin\slice2freeze.exe" "..\..\..\bin\slice2java.exe"
+# Begin Custom Build
+InputPath=.\Test.ice
+
+BuildCmds= \
+ set PATH=%PATH%;..\..\..\lib \
+ ..\..\..\bin\slice2cpp.exe Test.ice \
+ ..\..\..\bin\slice2freeze.exe --dict IntIntMap,int,int --dict Struct1Struct2Map,Struct1,Struct2 --dict Struct1Class1Map,Struct1,Class1 --dict Struct1ObjectMap,Struct1,Object BenchTypes Test.ice \
+
+
+"Test.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Test.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"BenchTypes.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"BenchTypes.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "bench - Win32 Debug"
+
+USERDEP__TEST_="..\..\..\bin\slice2freeze.exe" "..\..\..\bin\slice2cpp.exe"
+# Begin Custom Build
+InputPath=.\Test.ice
+
+BuildCmds= \
+ set PATH=%PATH%;..\..\..\lib \
+ ..\..\..\bin\slice2cpp.exe Test.ice \
+ ..\..\..\bin\slice2freeze.exe --dict IntIntMap,int,int --dict Struct1Struct2Map,Struct1,Struct2 --dict Struct1Class1Map,Struct1,Class1 --dict Struct1ObjectMap,Struct1,Object BenchTypes Test.ice \
+
+
+"Test.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Test.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"BenchTypes.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"BenchTypes.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/cpp/include/IceUtil/Cond.h b/cpp/include/IceUtil/Cond.h index fc4300f8355..6d3fabfdcff 100644 --- a/cpp/include/IceUtil/Cond.h +++ b/cpp/include/IceUtil/Cond.h @@ -175,17 +175,105 @@ private: } */ - void waitImpl(const RecMutex&) const; - void waitImpl(const Mutex&) const; - bool timedwaitImpl(const RecMutex&, long) const; - bool timedwaitImpl(const Mutex&, long) const; + // + // TODO: Should not be inlined, not performance critical. + // + void + waitImpl(const RecMutex& mutex) const + { + preWait(); + + RecMutex::LockState state; + mutex.unlock(state); + + try + { + dowait(-1); + mutex.lock(state); + } + catch(...) + { + mutex.lock(state); + throw; + } + } + + // + // TODO: Should not be inlined, not performance critical. + // + void + waitImpl(const Mutex& mutex) const + { + preWait(); + + Mutex::LockState state; + mutex.unlock(state); + + try + { + dowait(-1); + mutex.lock(state); + } + catch(...) + { + mutex.lock(state); + throw; + } + } + + // + // TODO: Should not be inlined, not performance critical. + // + bool + timedwaitImpl(const RecMutex& mutex, long msec) const + { + preWait(); + + RecMutex::LockState state; + mutex.unlock(state); + + try + { + bool rc = dowait(msec); + mutex.lock(state); + return rc; + } + catch(...) + { + mutex.lock(state); + throw; + } + } + + // + // TODO: Should not be inlined, not performance critical. + // + bool + timedwaitImpl(const Mutex& mutex, long msec) const + { + preWait(); + + Mutex::LockState state; + mutex.unlock(state); + + try + { + bool rc = dowait(msec); + mutex.lock(state); + return rc; + } + catch(...) + { + mutex.lock(state); + throw; + } + } #else template <typename M> void waitImpl(const M&) const; template <typename M> bool timedwaitImpl(const M&, long) const; - #endif #ifdef WIN32 diff --git a/cpp/src/IceUtil/Cond.cpp b/cpp/src/IceUtil/Cond.cpp index 9487e590931..807295d2441 100644 --- a/cpp/src/IceUtil/Cond.cpp +++ b/cpp/src/IceUtil/Cond.cpp @@ -80,88 +80,6 @@ IceUtil::Cond::broadcast() } void -IceUtil::Cond::waitImpl(const RecMutex& mutex) const -{ - preWait(); - - RecMutex::LockState state; - mutex.unlock(state); - - try - { - dowait(-1); - mutex.lock(state); - } - catch(...) - { - mutex.lock(state); - throw; - } -} - -void -IceUtil::Cond::waitImpl(const Mutex& mutex) const -{ - preWait(); - - Mutex::LockState state; - mutex.unlock(state); - - try - { - dowait(-1); - mutex.lock(state); - } - catch(...) - { - mutex.lock(state); - throw; - } -} - -bool -IceUtil::Cond::timedwaitImpl(const RecMutex& mutex, long msec) const -{ - preWait(); - - RecMutex::LockState state; - mutex.unlock(state); - - try - { - bool rc = dowait(msec); - mutex.lock(state); - return rc; - } - catch(...) - { - mutex.lock(state); - throw; - } -} - -bool -IceUtil::Cond::timedwaitImpl(const Mutex& mutex, long msec) const -{ - preWait(); - - Mutex::LockState state; - mutex.unlock(state); - - try - { - bool rc = dowait(msec); - mutex.lock(state); - return rc; - } - catch(...) - { - mutex.lock(state); - throw; - } -} - -void IceUtil::Cond::wake(bool broadcast) { // |