Changeset 1161:636acc108cd9
- Timestamp:
- 02/22/09 13:47:43 (3 years ago)
- Branch:
- libdodo
- Location:
- trunk
- Files:
-
- 4 deleted
- 28 edited
- 2 moved
-
Makefile.in (modified) (7 diffs)
-
configure.in (modified) (39 diffs)
-
include/libdodo/cgiFastExchange.h (modified) (1 diff)
-
include/libdodo/cgiFastServer.h (modified) (1 diff)
-
include/libdodo/ioChannel.h (modified) (3 diffs)
-
include/libdodo/ioEvent.h (modified) (3 diffs)
-
include/libdodo/ioNetworkExchange.h (modified) (1 diff)
-
include/libdodo/ioNetworkSslExchange.h (modified) (1 diff)
-
include/libdodo/ioPipe.h (modified) (1 diff)
-
include/libdodo/ioStdio.h (modified) (1 diff)
-
include/libdodo/pcSyncDataCollection.h (modified) (1 diff)
-
include/libdodo/pcSyncProcessDataCollection.h (modified) (3 diffs)
-
include/libdodo/pcSyncProcessStack.h (deleted)
-
include/libdodo/pcSyncProtector.h (moved) (moved from trunk/include/libdodo/pcSyncStack.h) (3 diffs)
-
include/libdodo/pcSyncThreadDataCollection.h (modified) (3 diffs)
-
include/libdodo/pcSyncThreadStack.h (deleted)
-
include/libdodo/toolsCode.h (modified) (1 diff)
-
include/libdodo/toolsLogger.h (modified) (3 diffs)
-
src/ioChannel.cc (modified) (6 diffs)
-
src/ioEvent.cc (modified) (8 diffs)
-
src/ioFileFifo.cc (modified) (8 diffs)
-
src/ioFileRegular.cc (modified) (7 diffs)
-
src/ioFileTemp.cc (modified) (7 diffs)
-
src/ioNetworkExchange.cc (modified) (5 diffs)
-
src/ioNetworkSslExchange.cc (modified) (3 diffs)
-
src/ioPipe.cc (modified) (9 diffs)
-
src/ioString.cc (modified) (2 diffs)
-
src/pcSyncProcessDataCollection.cc (modified) (6 diffs)
-
src/pcSyncProcessStack.cc (deleted)
-
src/pcSyncProtector.cc (moved) (moved from trunk/src/pcSyncStack.cc) (2 diffs)
-
src/pcSyncThreadDataCollection.cc (modified) (6 diffs)
-
src/pcSyncThreadStack.cc (deleted)
-
src/toolsLogger.cc (modified) (5 diffs)
-
tests/pcprocesscollection_test/test.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r1123 r1161 1 2 1 prefix:=@prefix@ 3 2 datarootdir:=@datarootdir@ … … 13 12 14 13 CPPFLAGS:=-I./include @CPPFLAGS@ 15 LDFLAGS:=-L./ @LDFLAGS@ 14 LDFLAGS:=-L./ @LDFLAGS@ 16 15 CFLAGS:=@CFLAGS@ @DEFS@ 17 16 … … 86 85 graphicsDraw.o \ 87 86 graphicsColor.o \ 88 pcSync Stack.o \87 pcSyncProtector.o \ 89 88 pcSyncSection.o \ 90 89 pcSyncThreadSection.o \ … … 93 92 pcThreadCollection.o \ 94 93 pcJobCollection.o \ 95 pcSyncThreadStack.o \96 pcSyncProcessStack.o \97 94 pcSyncThreadDataSingle.o \ 98 95 pcSyncProcessDataSingle.o \ … … 121 118 @rm -f $@.so 122 119 @$(LN_S) @PACKAGE_NAME@.so.@SO_VERSION@ $@.so 123 120 124 121 @echo "" 125 122 @echo "" … … 153 150 @echo "-- Installing: ${DESTDIR}$(bindir)/dodo-config" 154 151 @echo ${DESTDIR}$(bindir)/dodo-config >> install_manifest.txt 155 152 156 153 @echo "" 157 154 @echo "" … … 162 159 clean: 163 160 @rm -rf *.o *.so* *.a* 164 -
trunk/configure.in
r1140 r1161 1 2 1 AC_PREREQ(2.60) 3 2 … … 82 81 AC_SUBST(DEBUG) 83 82 AC_ARG_ENABLE(debug, 84 AS_HELP_STRING([--enable-debug], [enable debug info]), 83 AS_HELP_STRING([--enable-debug], [enable debug info]), 85 84 [DEBUG="$enableval"], [DEBUG="no"]) 86 85 if test "$DEBUG" = "yes" 87 86 then 88 87 CFLAGS="$CFLAGS -g -DDEBUG" 89 88 90 89 RESULT="$RESULT\nDebug\t\t\t\t\t\t\t\tenabled" 91 90 else … … 94 93 95 94 AC_ARG_ENABLE(profiling, 96 AS_HELP_STRING([--enable-profiling], [enable profiling]), 95 AS_HELP_STRING([--enable-profiling], [enable profiling]), 97 96 [PROFILING="$enableval"], [PROFILING="no"]) 98 97 if test "$PROFILING" = "yes" 99 98 then 100 99 CFLAGS="$CFLAGS -pg" 101 100 102 101 RESULT="$RESULT\nProfiling\t\t\t\t\t\t\tenabled" 103 102 else … … 106 105 107 106 AC_ARG_ENABLE(libwrap, 108 AS_HELP_STRING([--disable-libwrap], [disable libwrap support]), 107 AS_HELP_STRING([--disable-libwrap], [disable libwrap support]), 109 108 [LIBWRAP="$enableval"], [LIBWRAP="yes"]) 110 109 if test "$LIBWRAP" = "yes" … … 114 113 then 115 114 LDFLAGS="$LDFLAGS -lwrap" 116 115 117 116 RESULT="$RESULT\nlibwrap\t\t\t\t\t\t\t\tenabled" 118 117 else … … 124 123 125 124 AC_ARG_ENABLE(deque, 126 AS_HELP_STRING([--disable-deque], [use std::vector instead of std::deque]), 125 AS_HELP_STRING([--disable-deque], [use std::vector instead of std::deque]), 127 126 [DEQUE="$enableval"], [DEQUE="yes"]) 128 127 if test "$DEQUE" = "yes" 129 128 then 130 echo -n -e "#define USE_DEQUE 1\n\n" >> include/libdodo/directives.runtime.h 131 129 echo -n -e "#define USE_DEQUE 1\n\n" >> include/libdodo/directives.runtime.h 130 132 131 RESULT="$RESULT\nDeque\t\t\t\t\t\t\t\tenabled" 133 132 else … … 136 135 137 136 AC_ARG_ENABLE(io-xexec, 138 AS_HELP_STRING([--disable-io-xexec], [compile io:: w/o xexec support]), 137 AS_HELP_STRING([--disable-io-xexec], [compile io:: w/o xexec support]), 139 138 [IO_W_XEXEC="$enableval"], [IO_W_XEXEC="yes"]) 140 139 if test "$IO_W_XEXEC" = "no" 141 140 then 142 echo -n -e "#define IO_WO_XEXEC 1\n\n" >> include/libdodo/directives.runtime.h 141 echo -n -e "#define IO_WO_XEXEC 1\n\n" >> include/libdodo/directives.runtime.h 143 142 RESULT="$RESULT\nio::stdio xexec support\t\t\t\t\t\tdisabled" 144 143 RESULT="$RESULT\nio::network::exchange xexec support\t\t\t\tdisabled" … … 165 164 if test "$DATABASE_W_XEXEC" = "no" 166 165 then 167 echo -n -e "#define DATABASE_WO_XEXEC 1\n\n" >> include/libdodo/directives.runtime.h 166 echo -n -e "#define DATABASE_WO_XEXEC 1\n\n" >> include/libdodo/directives.runtime.h 168 167 fi 169 168 … … 188 187 189 188 AC_ARG_WITH([sqlite3], 190 AS_HELP_STRING([--with-sqlite3@<:@=DIR@:>@], [use sqlite3]), 189 AS_HELP_STRING([--with-sqlite3@<:@=DIR@:>@], [use sqlite3]), 191 190 [MOD_SQLITE3_DIR="$withval"], [MOD_SQLITE3="no"]) 192 191 if test "$MOD_SQLITE3" != "no" -a "$MOD_SQLITE3_DIR" != "no" … … 202 201 AC_CHECK_HEADER([sqlite3.h], [], AC_MSG_ERROR(sqlite3 header was not found)) 203 202 echo -n -e "#define SQLITE3_EXT 1\n\n" >> include/libdodo/directives.runtime.h 204 203 205 204 RESULT="$RESULT\nSQLite\t\t\t\t\t\t\t\tenabled" 206 205 … … 216 215 217 216 AC_ARG_WITH([openssl], 218 AS_HELP_STRING([--with-openssl@<:@=DIR@:>@], [use openssl]), 217 AS_HELP_STRING([--with-openssl@<:@=DIR@:>@], [use openssl]), 219 218 [MOD_OPENSSL_DIR="$withval"], [MOD_OPENSSL="no"]) 220 219 if test "$MOD_OPENSSL" != "no" -a "$MOD_OPENSSL_DIR" != "no" … … 257 256 258 257 AC_ARG_WITH([bfd], 259 AS_HELP_STRING([--with-bfd@<:@=DIR@:>@], [support library name resolution]), 258 AS_HELP_STRING([--with-bfd@<:@=DIR@:>@], [support library name resolution]), 260 259 [MOD_BFD_DIR="$withval"], [MOD_BFD="no"]) 261 260 if test "$MOD_BFD" != "no" -a "$MOD_BFD_DIR" != "no" … … 277 276 278 277 AC_ARG_WITH([postgresql], 279 AS_HELP_STRING([--with-postgresql@<:@=DIR@:>@], [use postgresql]), 278 AS_HELP_STRING([--with-postgresql@<:@=DIR@:>@], [use postgresql]), 280 279 [MOD_POSTGRESQL_DIR="$withval"], [MOD_POSTGRESQL="no"]) 281 280 if test "$MOD_POSTGRESQL" != "no" -a "$MOD_POSTGRESQL_DIR" != "no" … … 298 297 AC_CHECK_LIB([pq], [PQexecParams], [], AC_MSG_ERROR(postgresql lib was not found)) 299 298 AC_CHECK_HEADER([libpq-fe.h], [], AC_MSG_ERROR(postgresql header was not found)) 300 299 301 300 AC_LANG_PUSH(C++) 302 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <libpq-fe.h>]], [[pg_encoding_to_char(0);]]), [], 301 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <libpq-fe.h>]], [[pg_encoding_to_char(0);]]), [], 303 302 [echo -n -e "#define POSTGRESQL_NO_ENCODINGTOCHAR 1\n\n" >> include/libdodo/directives.runtime.h]) 304 303 AC_LANG_POP() … … 319 318 320 319 AC_ARG_WITH([mysql], 321 AS_HELP_STRING([--with-mysql@<:@=DIR@:>@], [use mysql]), 320 AS_HELP_STRING([--with-mysql@<:@=DIR@:>@], [use mysql]), 322 321 [MOD_MYSQL_DIR="$withval"], [MOD_MYSQL="no"]) 323 322 if test "$MOD_MYSQL" != "no" -a "$MOD_MYSQL_DIR" != "no" … … 341 340 AC_CHECK_LIB([mysqlclient], [mysql_init], [], AC_MSG_ERROR(mySQL lib was not found)) 342 341 AC_CHECK_HEADER([mysql.h], [], AC_MSG_ERROR(mySQL header was not found)) 343 342 344 343 AC_LANG_PUSH(C++) 345 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <mysql.h>]], [[my_bool rc = 1; mysql_options(0, MYSQL_OPT_RECONNECT, &rc);]]), [], 344 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <mysql.h>]], [[my_bool rc = 1; mysql_options(0, MYSQL_OPT_RECONNECT, &rc);]]), [], 346 345 [echo -n -e "#define MYSQL_NO_OPT_RECONNECT 1\n\n" >> include/libdodo/directives.runtime.h]) 347 346 AC_LANG_POP() 348 347 349 348 echo -n -e "#define MYSQL_EXT 1\n\n" >> include/libdodo/directives.runtime.h 350 349 … … 355 354 RESULT="$RESULT\ndata::base::mysql xexec support\t\t\t\t\tenabled" 356 355 fi 357 356 358 357 RESULT="$RESULT\nMySQL\t\t\t\t\t\t\t\tenabled" 359 358 else … … 362 361 363 362 AC_ARG_WITH([fast-cgi], 364 AS_HELP_STRING([--with-fast-cgi@<:@=DIR@:>@], [use fast CGI]), 363 AS_HELP_STRING([--with-fast-cgi@<:@=DIR@:>@], [use fast CGI]), 365 364 [MOD_FASTCGI_DIR="$withval"], [MOD_FASTCGI="no"]) 366 365 if test "$MOD_FASTCGI" != "no" -a "$MOD_FASTCGI_DIR" != "no" … … 382 381 RESULT="$RESULT\ncgi::fast::exchange xexec support\t\t\t\tenabled" 383 382 fi 384 383 385 384 RESULT="$RESULT\nFastCGI\t\t\t\t\t\t\t\tenabled" 386 385 else … … 389 388 390 389 AC_ARG_WITH([pcre], 391 AS_HELP_STRING([--with-pcre@<:@=DIR@:>@], [use pcre]), 390 AS_HELP_STRING([--with-pcre@<:@=DIR@:>@], [use pcre]), 392 391 [MOD_PCRE_DIR="$withval"], [MOD_PCRE="no"]) 393 392 if test "$MOD_PCRE" != "no" -a "$MOD_PCRE_DIR" != "no" … … 406 405 AC_CHECK_HEADER([pcre.h], [], AC_MSG_ERROR(pcre header was not found)) 407 406 echo -n -e "#define PCRE_EXT 1\n\n" >> include/libdodo/directives.runtime.h 408 407 409 408 RESULT="$RESULT\nPCRE\t\t\t\t\t\t\t\tenabled" 410 409 else … … 414 413 415 414 AC_ARG_ENABLE(dl, 416 AS_HELP_STRING([--enable-dl], [enable dynamic loading]), 415 AS_HELP_STRING([--enable-dl], [enable dynamic loading]), 417 416 [DL="$enableval"], [DL="no"]) 418 417 if test "$DL" = "yes" 419 418 then 420 419 echo -n -e "#define DL_EXT 1\n\n" >> include/libdodo/directives.runtime.h 421 420 422 421 AC_ARG_ENABLE(fast-dynamic-loading, 423 AS_HELP_STRING([--disable-fast-dynamic-loading], [do not unload library to produce better performance]), 422 AS_HELP_STRING([--disable-fast-dynamic-loading], [do not unload library to produce better performance]), 424 423 [DL_FAST="$enableval"], [DL_FAST="yes"]) 425 424 426 425 if test "$DL_FAST" = "yes" -a "$OS" = "Linux" 427 426 then 428 echo -n -e "#define DL_FAST 1\n\n" >> include/libdodo/directives.runtime.h 427 echo -n -e "#define DL_FAST 1\n\n" >> include/libdodo/directives.runtime.h 429 428 430 429 RESULT="$RESULT\nFast dynamic loading\t\t\t\t\t\tenabled" … … 439 438 440 439 AC_ARG_WITH([libxml2], 441 AS_HELP_STRING([--with-libxml2@<:@=DIR@:>@], [use libxml2]), 440 AS_HELP_STRING([--with-libxml2@<:@=DIR@:>@], [use libxml2]), 442 441 [MOD_LIBXML2_DIR="$withval"], [MOD_LIBXML2="no"]) 443 442 if test "$MOD_LIBXML2" != "no" -a "$MOD_LIBXML2_DIR" != "no" … … 462 461 AC_CHECK_HEADER([libxml/xmlmemory.h], [], AC_MSG_ERROR(libxml2 header was not found)) 463 462 echo -n -e "#define LIBXML2_EXT 1\n\n" >> include/libdodo/directives.runtime.h 464 463 465 464 RESULT="$RESULT\nlibxml2\t\t\t\t\t\t\t\tenabled" 466 465 else … … 469 468 470 469 AC_ARG_WITH([threading-lib], 471 AS_HELP_STRING([--with-threading-lib@<:@=lib@:>@], [specify threading library(supported: pthread), pthread by default]), 470 AS_HELP_STRING([--with-threading-lib@<:@=lib@:>@], [specify threading library(supported: pthread), pthread by default]), 472 471 [MOD_THREAD="$withval"], [MOD_THREAD="pthread"]) 473 472 case "$MOD_THREAD" in 474 473 pthread) 475 474 AC_ARG_WITH([pthread-lib], 476 AS_HELP_STRING([--with-pthread-lib@<:@=lib@:>@], [use pthread library(supported: pthread, thr, lthread, c_r), pthread by default]), 475 AS_HELP_STRING([--with-pthread-lib@<:@=lib@:>@], [use pthread library(supported: pthread, thr, lthread, c_r), pthread by default]), 477 476 [MOD_PTHREAD_LIB="$withval"], [MOD_PTHREAD_LIB="pthread"]) 478 477 AC_ARG_WITH([pthread-path], 479 AS_HELP_STRING([--with-pthread-path@<:@=DIR@:>@], [path to pthread installation]), 478 AS_HELP_STRING([--with-pthread-path@<:@=DIR@:>@], [path to pthread installation]), 480 479 [MOD_PTHREAD_DIR="$withval"], [MOD_PTHREAD_DIR="/usr"]) 481 480 CPPFLAGS="$CPPFLAGS -I$MOD_PTHREAD_DIR/include" … … 492 491 493 492 AC_ARG_WITH([bzip2], 494 AS_HELP_STRING([--with-bzip2@<:@=DIR@:>@], [use bzip2]), 493 AS_HELP_STRING([--with-bzip2@<:@=DIR@:>@], [use bzip2]), 495 494 [MOD_BZIP2_DIR="$withval"], [MOD_BZIP2="no"]) 496 495 if test "$MOD_BZIP2" != "no" -a "$MOD_BZIP2_DIR" != "no" … … 505 504 AC_CHECK_HEADER([bzlib.h], [], AC_MSG_ERROR(bz2 header was not found)) 506 505 echo -n -e "#define BZIP2_EXT 1\n\n" >> include/libdodo/directives.runtime.h 507 506 508 507 RESULT="$RESULT\nBZIP2\t\t\t\t\t\t\t\tenabled" 509 508 else … … 512 511 513 512 AC_ARG_WITH([zlib], 514 AS_HELP_STRING([--with-zlib@<:@=DIR@:>@], [use zlib]), 513 AS_HELP_STRING([--with-zlib@<:@=DIR@:>@], [use zlib]), 515 514 [MOD_ZLIB_DIR="$withval"], [MOD_ZLIB="no"]) 516 515 if test "$MOD_ZLIB" != "no" -a "$MOD_ZLIB_DIR" != "no" … … 524 523 AC_CHECK_HEADER([zlib.h]) 525 524 AC_ARG_ENABLE([zlib-lib], 526 AS_HELP_STRING([--enable-zlib-lib], [enable zlib as lib]), 525 AS_HELP_STRING([--enable-zlib-lib], [enable zlib as lib]), 527 526 [MOD_ZLIB_LIB="yes"], [MOD_ZLIB_LIB="no"]) 528 527 if test "$MOD_ZLIB_LIB" = "yes" … … 532 531 fi 533 532 echo -n -e "#define ZLIB_EXT 1\n\n" >> include/libdodo/directives.runtime.h 534 533 535 534 RESULT="$RESULT\nZLIB\t\t\t\t\t\t\t\tenabled" 536 535 else … … 539 538 540 539 AC_ARG_WITH([iconv], 541 AS_HELP_STRING([--with-iconv@<:@=DIR@:>@], [use iconv]), 540 AS_HELP_STRING([--with-iconv@<:@=DIR@:>@], [use iconv]), 542 541 [MOD_ICONV_DIR="$withval"], [MOD_ICONV="no"]) 543 542 if test "$MOD_ICONV" != "no" -a "$MOD_ICONV_DIR" != "no" … … 551 550 AC_CHECK_HEADER([iconv.h]) 552 551 AC_ARG_ENABLE([iconv-lib], 553 AS_HELP_STRING([--enable-iconv-lib], [enable iconv as lib]), 552 AS_HELP_STRING([--enable-iconv-lib], [enable iconv as lib]), 554 553 [MOD_ICONV_LIB="yes"], [MOD_ICONV_LIB="no"]) 555 554 if test "$MOD_ICONV_LIB" = "yes" … … 559 558 fi 560 559 echo -n -e "#define ICONV_EXT 1\n\n" >> include/libdodo/directives.runtime.h 561 560 562 561 RESULT="$RESULT\niconv\t\t\t\t\t\t\t\tenabled" 563 562 else … … 566 565 567 566 AC_ARG_WITH([imagemagick], 568 AS_HELP_STRING([--with-imagemagick@<:@=DIR@:>@], [use ImageMagick]), 567 AS_HELP_STRING([--with-imagemagick@<:@=DIR@:>@], [use ImageMagick]), 569 568 [MOD_IMAGEMAGICK_DIR="$withval"], [MOD_IMAGEMAGICK="no"]) 570 569 if test "$MOD_IMAGEMAGICK" != "no" -a "$MOD_IMAGEMAGICK_DIR" != "no" … … 601 600 else 602 601 LDFLAGS="$LDFLAGS -lMagickCore" 603 602 604 603 fi 605 604 if test "$VERY_OLD_IMAGEMAGICK_LIB" != "yes" … … 612 611 613 612 AC_ARG_ENABLE(graphics-xexec, 614 AS_HELP_STRING([--disable-graphics-xexec], [compile graphics w/o xexec support]), 613 AS_HELP_STRING([--disable-graphics-xexec], [compile graphics w/o xexec support]), 615 614 [GRAPHICS_W_XEXEC="$enableval"], [GRAPHICS_W_XEXEC="yes"]) 616 615 if test "$GRAPHICS_W_XEXEC" = "no" 617 616 then 618 echo -n -e "#define GRAPHICS_WO_XEXEC 1\n\n" >> include/libdodo/directives.runtime.h 619 617 echo -n -e "#define GRAPHICS_WO_XEXEC 1\n\n" >> include/libdodo/directives.runtime.h 618 620 619 RESULT="$RESULT\ngraphics xexec support\t\t\t\t\t\tdisabled" 621 620 else 622 621 RESULT="$RESULT\ngraphics xexec support\t\t\t\t\t\tenabled" 623 622 fi 624 623 625 624 RESULT="$RESULT\nImageMagick\t\t\t\t\t\t\tenabled" 626 625 else … … 736 735 AC_LANG_POP() 737 736 738 echo -n -e "#define CALLSTACK_EX 1\n\n" >> include/libdodo/directives.runtime.h 737 echo -n -e "#define CALLSTACK_EX 1\n\n" >> include/libdodo/directives.runtime.h 739 738 fi 740 739 … … 743 742 AC_CHECK_HEADER([dlfcn.h], [], [AC_MSG_ERROR(dlfcn.h header was not found)]) 744 743 AC_ARG_ENABLE([dl-lib], 745 AS_HELP_STRING([--disable-dl-lib], [disable dl as lib]), 744 AS_HELP_STRING([--disable-dl-lib], [disable dl as lib]), 746 745 [MOD_DL_LIB="$enableval"], [MOD_DL_LIB="yes"]) 747 746 if test "$MOD_DL_LIB" = "yes" … … 752 751 fi 753 752 754 echo -n -e "#endif\n" >> include/libdodo/directives.runtime.h 753 echo -n -e "#endif\n" >> include/libdodo/directives.runtime.h 755 754 756 755 ## -
trunk/include/libdodo/cgiFastExchange.h
r1160 r1161 41 41 #include <libdodo/cgiExchange.h> 42 42 #include <libdodo/ioChannel.h> 43 #include <libdodo/pcSyncThreadStack.h>44 43 45 44 namespace dodo -
trunk/include/libdodo/cgiFastServer.h
r1160 r1161 48 48 #include <libdodo/cgiFastExchange.h> 49 49 #include <libdodo/ioChannel.h> 50 #include <libdodo/pcSyncThreadStack.h>51 50 52 51 namespace dodo -
trunk/include/libdodo/ioChannel.h
r1160 r1161 36 36 #include <libdodo/types.h> 37 37 #include <libdodo/ioEventInfo.h> 38 #include <libdodo/pcSyncThreadStack.h> 38 #include <libdodo/pcSyncProcessSection.h> 39 #include <libdodo/pcSyncProtector.h> 39 40 40 41 namespace dodo … … 83 84 * @brief implements an interface for I/O operations 84 85 */ 85 class channel : virtual public eventInfo, 86 virtual public pc::sync::thread::stack 86 class channel : virtual public eventInfo 87 87 #ifndef IO_WO_XEXEC 88 88 , … … 169 169 170 170 #endif 171 pc::sync::section *keeper; ///< section locker 171 172 }; 172 173 }; -
trunk/include/libdodo/ioEvent.h
r1160 r1161 40 40 #include <libdodo/toolsMisc.h> 41 41 #include <libdodo/ioEventInfo.h> 42 #include <libdodo/pcSyncThreadStack.h> 42 #include <libdodo/pcSyncProcessSection.h> 43 #include <libdodo/pcSyncProtector.h> 43 44 44 45 namespace dodo … … 62 63 * @brief provides information if in/output stream is readable/writable 63 64 */ 64 class event : virtual public pc::sync::thread::stack65 class event 65 66 { 66 67 private: … … 137 138 138 139 int descs; ///< descriptors counter 140 141 pc::sync::section *keeper; ///< section locker 139 142 }; 140 143 }; -
trunk/include/libdodo/ioNetworkExchange.h
r1160 r1161 49 49 #include <libdodo/types.h> 50 50 #include <libdodo/xexec.h> 51 #include <libdodo/pcSyncThreadStack.h>52 51 53 52 namespace dodo -
trunk/include/libdodo/ioNetworkSslExchange.h
r1160 r1161 53 53 #include <libdodo/types.h> 54 54 #include <libdodo/xexec.h> 55 #include <libdodo/pcSyncThreadStack.h>56 55 57 56 namespace dodo -
trunk/include/libdodo/ioPipe.h
r1160 r1161 45 45 #include <libdodo/ioChannel.h> 46 46 #include <libdodo/ioNetwork.h> 47 #include <libdodo/pcSyncThreadStack.h>48 47 49 48 namespace dodo -
trunk/include/libdodo/ioStdio.h
r1160 r1161 42 42 #include <libdodo/types.h> 43 43 #include <libdodo/ioPipe.h> 44 #include <libdodo/pcSyncThreadStack.h>45 44 46 45 namespace dodo -
trunk/include/libdodo/pcSyncDataCollection.h
r1160 r1161 34 34 35 35 #include <libdodo/types.h> 36 #include <libdodo/pcSyncStack.h>37 36 38 37 namespace dodo -
trunk/include/libdodo/pcSyncProcessDataCollection.h
r1160 r1161 36 36 #include <libdodo/pcSyncDataCollection.h> 37 37 #include <libdodo/pcSyncProcessDataCollectionEx.h> 38 #include <libdodo/pcSyncProcessStack.h> 38 #include <libdodo/pcSyncProcessSection.h> 39 #include <libdodo/pcSyncProtector.h> 39 40 40 41 namespace dodo … … 52 53 * @brief implements collection of shared data for processes 53 54 */ 54 class collection : public sync::data::collection, 55 virtual public sync::process::stack 55 class collection : public sync::data::collection 56 56 { 57 57 private: … … 123 123 124 124 dodoList<pc::sync::data::__info>::iterator current; ///< iterator for list of shared data[for matched with getShare method] 125 126 section *keeper; ///< section locker 125 127 }; 126 128 }; -
trunk/include/libdodo/pcSyncProtector.h
r1160 r1161 1 1 /*************************************************************************** 2 * pcSync Stack.h2 * pcSyncProtector.h 3 3 * 4 4 * Sat Oct 20 02:00:55 2007 … … 28 28 */ 29 29 30 #ifndef _PCSYNC STACK_H_31 #define _PCSYNC STACK_H_ 130 #ifndef _PCSYNCPROTECTOR_H_ 31 #define _PCSYNCPROTECTOR_H_ 1 32 32 33 33 #include <libdodo/directives.h> … … 44 44 { 45 45 /** 46 * @class stack 47 * @brief provides mutex lock and guard class 46 * @class protector 47 * @brief provides thread/process safe behaviour 48 * @note it locks in constructor and unlocks in destructor 48 49 */ 49 class stack50 class protector 50 51 { 51 p rotected:52 public: 52 53 53 section *keeper; ///< lock 54 /** 55 * contructor 56 */ 57 protector(section *parent); 54 58 55 59 /** 56 60 * destructor 57 61 */ 58 virtual ~ stack() = 0;62 virtual ~protector(); 59 63 60 /** 61 * @class protector 62 * @brief provides thread safe behaviour 63 * @note it locks in constructor and unlocks in destructor 64 */ 65 class protector 66 { 67 public: 64 protected: 68 65 69 /** 70 * contructor 71 */ 72 protector(const stack *parent); 73 74 /** 75 * destructor 76 */ 77 virtual ~protector(); 78 79 protected: 80 81 const stack *parent; ///< lock 82 }; 66 section *keeper; ///< lock 83 67 }; 84 68 }; -
trunk/include/libdodo/pcSyncThreadDataCollection.h
r1160 r1161 36 36 #include <libdodo/pcSyncDataCollection.h> 37 37 #include <libdodo/pcSyncThreadDataCollectionEx.h> 38 #include <libdodo/pcSyncThreadStack.h> 38 #include <libdodo/pcSyncProtector.h> 39 #include <libdodo/pcSyncThreadSection.h> 39 40 40 41 namespace dodo … … 52 53 * @brief implements collection of shared data for threads 53 54 */ 54 class collection : public sync::data::collection, 55 virtual public sync::thread::stack 55 class collection : public sync::data::collection 56 56 { 57 57 private: … … 123 123 124 124 dodoList<pc::sync::data::__info>::iterator current; ///< iterator for list of shared data[for matched with getShare method] 125 126 section *keeper; ///< section locker 125 127 }; 126 128 }; -
trunk/include/libdodo/toolsCode.h
r1160 r1161 58 58 59 59 #include <libdodo/types.h> 60 #include <libdodo/ioNetwork.h>61 #include <libdodo/toolsNetwork.h>62 60 #include <libdodo/toolsString.h> 63 61 #include <libdodo/toolsCodeEx.h> -
trunk/include/libdodo/toolsLogger.h
r1160 r1161 35 35 #include <libdodo/ioChannel.h> 36 36 #include <libdodo/toolsTime.h> 37 #include <libdodo/pcSyncThreadStack.h> 37 #include <libdodo/pcSyncProcessSection.h> 38 #include <libdodo/pcSyncProtector.h> 38 39 #include <libdodo/types.h> 39 40 … … 77 78 * @brief provides logging function 78 79 */ 79 class logger : virtual public pc::sync::thread::stack, 80 public singleton<logger> 80 class logger : public singleton<logger> 81 81 { 82 82 public: … … 135 135 static const dodoString levels[LOGGER_LEVELS]; ///< log levels statements 136 136 static const int syslogLevels[LOGGER_LEVELS]; ///< syslog log levels 137 138 pc::sync::section *keeper; ///< section locker 137 139 }; 138 140 }; -
trunk/src/ioChannel.cc
r1160 r1161 44 44 45 45 channel::channel() : inSize(IO_INSIZE), 46 outSize(IO_OUTSIZE) 46 outSize(IO_OUTSIZE), 47 keeper(new pc::sync::process::section) 47 48 48 49 #ifndef IO_WO_XEXEC … … 59 60 channel::~channel() 60 61 { 62 delete keeper; 61 63 } 62 64 … … 65 67 dodoString channel::read() 66 68 { 67 p rotector pg(this);69 pc::sync::protector pg(keeper); 68 70 69 71 dodoString a_str; … … 125 127 dodoString channel::readStream() 126 128 { 127 p rotector pg(this);129 pc::sync::protector pg(keeper); 128 130 129 131 dodoString a_str; … … 191 193 void channel::write(const dodoString &a_data) 192 194 { 193 p rotector pg(this);195 pc::sync::protector pg(keeper); 194 196 195 197 #ifndef IO_WO_XEXEC … … 228 230 void channel::writeStream(const dodoString &a_data) 229 231 { 230 p rotector pg(this);232 pc::sync::protector pg(keeper); 231 233 232 234 #ifndef IO_WO_XEXEC -
trunk/src/ioEvent.cc
r1160 r1161 40 40 //------------------------------------------------------------------- 41 41 42 event::event() : descs(0) 42 event::event() : descs(0), 43 keeper(new pc::sync::process::section) 43 44 { 44 45 } … … 48 49 event::~event() 49 50 { 51 delete keeper; 50 52 } 51 53 … … 54 56 int event::addChannel(const eventInfo &fl) 55 57 { 56 protector pg(this);58 pc::sync::protector pg(keeper); 57 59 58 60 __eventInOutDescriptors tempD; … … 72 74 int timeout) const 73 75 { 74 protector pg(this);76 pc::sync::protector pg(keeper); 75 77 76 78 int count = -1; … … 157 159 int timeout) const 158 160 { 159 protector pg(this);161 pc::sync::protector pg(keeper); 160 162 161 163 int count = -1; … … 242 244 int timeout) const 243 245 { 244 protector pg(this);246 pc::sync::protector pg(keeper); 245 247 246 248 pollfd fd; … … 288 290 void event::delChannel(int pos) 289 291 { 290 protector pg(this);292 pc::sync::protector pg(keeper); 291 293 292 294 dodoArray<__eventInOutDescriptors>::iterator i(desc.begin()), j(desc.end()); … … 307 309 int timeout) const 308 310 { 309 protector pg(this);311 pc::sync::protector pg(keeper); 310 312 311 313 pollfd fd; -
trunk/src/ioFileFifo.cc
r1160 r1161 204 204 int fifo::getInDescriptor() const 205 205 { 206 protector pg(this);206 pc::sync::protector pg(keeper); 207 207 208 208 if (handler == NULL) … … 218 218 int fifo::getOutDescriptor() const 219 219 { 220 protector pg(this);220 pc::sync::protector pg(keeper); 221 221 222 222 if (handler == NULL) … … 232 232 void fifo::clone(const fifo &fd) 233 233 { 234 protector pg(this);234 pc::sync::protector pg(keeper); 235 235 236 236 if (handler != NULL) … … 293 293 void fifo::close() 294 294 { 295 protector pg(this);295 pc::sync::protector pg(keeper); 296 296 297 297 #ifndef IO_WO_XEXEC … … 320 320 short a_mode) 321 321 { 322 protector pg(this);322 pc::sync::protector pg(keeper); 323 323 324 324 #ifndef IO_WO_XEXEC … … 426 426 bool fifo::isBlocked() 427 427 { 428 protector pg(this);428 pc::sync::protector pg(keeper); 429 429 430 430 return blocked; … … 435 435 void fifo::block(bool flag) 436 436 { 437 protector pg(this);437 pc::sync::protector pg(keeper); 438 438 439 439 if (handler == NULL) … … 650 650 void fifo::flush() 651 651 { 652 protector pg(this);652 pc::sync::protector pg(keeper); 653 653 654 654 if (handler == NULL) -
trunk/src/ioFileRegular.cc
r1160 r1161 209 209 int regular::getInDescriptor() const 210 210 { 211 protector pg(this);211 pc::sync::protector pg(keeper); 212 212 213 213 if (handler == NULL) … … 223 223 int regular::getOutDescriptor() const 224 224 { 225 protector pg(this);225 pc::sync::protector pg(keeper); 226 226 227 227 if (handler == NULL) … … 237 237 void regular::clone(const regular &fd) 238 238 { 239 protector pg(this);239 pc::sync::protector pg(keeper); 240 240 241 241 if (handler != NULL) … … 306 306 void regular::close() 307 307 { 308 protector pg(this);308 pc::sync::protector pg(keeper); 309 309 310 310 #ifndef IO_WO_XEXEC … … 333 333 short a_mode) 334 334 { 335 protector pg(this);335 pc::sync::protector pg(keeper); 336 336 337 337 #ifndef IO_WO_XEXEC … … 543 543 void regular::erase() 544 544 { 545 protector pg(this);545 pc::sync::protector pg(keeper); 546 546 547 547 char *empty = new char[outSize]; … … 574 574 void regular::flush() 575 575 { 576 protector pg(this);576 pc::sync::protector pg(keeper); 577 577 578 578 if (handler == NULL) -
trunk/src/ioFileTemp.cc
r1160 r1161 111 111 int temp::getInDescriptor() const 112 112 { 113 protector pg(this);113 pc::sync::protector pg(keeper); 114 114 115 115 if (handler == NULL) … … 125 125 int temp::getOutDescriptor() const 126 126 { 127 protector pg(this);127 pc::sync::protector pg(keeper); 128 128 129 129 if (handler == NULL) … … 139 139 void temp::clone(const temp &fd) 140 140 { 141 protector pg(this);141 pc::sync::protector pg(keeper); 142 142 143 143 if (handler != NULL) … … 187 187 void temp::close() 188 188 { 189 protector pg(this);189 pc::sync::protector pg(keeper); 190 190 191 191 #ifndef IO_WO_XEXEC … … 213 213 void temp::open() 214 214 { 215 protector pg(this);215 pc::sync::protector pg(keeper); 216 216 217 217 #ifndef IO_WO_XEXEC … … 355 355 void temp::erase() 356 356 { 357 protector pg(this);357 pc::sync::protector pg(keeper); 358 358 359 359 char *empty = new char[outSize]; … … 386 386 void temp::flush() 387 387 { 388 protector pg(this);388 pc::sync::protector pg(keeper); 389 389 390 390 if (handler == NULL) -
trunk/src/ioNetworkExchange.cc
r1160 r1161 117 117 void exchange::close() 118 118 { 119 protector pg(this);119 pc::sync::protector pg(keeper); 120 120 121 121 #ifndef IO_WO_XEXEC … … 142 142 bool blockInherited) 143 143 { 144 protector pg(this);144 pc::sync::protector pg(keeper); 145 145 146 146 if (socket != -1) … … 183 183 bool exchange::isAlive() 184 184 { 185 protector pg(this);185 pc::sync::protector pg(keeper); 186 186 187 187 if (socket == -1) … … 449 449 int exchange::getInDescriptor() const 450 450 { 451 protector pg(this);451 pc::sync::protector pg(keeper); 452 452 453 453 return socket; … … 458 458 int exchange::getOutDescriptor() const 459 459 { 460 protector pg(this);460 pc::sync::protector pg(keeper); 461 461 462 462 return socket; -
trunk/src/ioNetworkSslExchange.cc
r1160 r1161 140 140 void exchange::close() 141 141 { 142 protector pg(this);142 pc::sync::protector pg(keeper); 143 143 144 144 #ifndef IO_WO_XEXEC … … 167 167 bool blockInherited) 168 168 { 169 protector pg(this);169 pc::sync::protector pg(keeper); 170 170 171 171 if (socket != -1) … … 210 210 bool exchange::isAlive() 211 211 { 212 protector pg(this);212 pc::sync::protector pg(keeper); 213 213 214 214 if (socket == -1) -
trunk/src/ioPipe.cc
r1160 r1161 145 145 void io::pipe::clone(const pipe &fd) 146 146 { 147 protector pg(this);147 pc::sync::protector pg(keeper); 148 148 149 149 if (inHandle != NULL) … … 219 219 int io::pipe::getInDescriptor() const 220 220 { 221 protector pg(this);221 pc::sync::protector pg(keeper); 222 222 223 223 if (inHandle == NULL) … … 233 233 int io::pipe::getOutDescriptor() const 234 234 { 235 protector pg(this);235 pc::sync::protector pg(keeper); 236 236 237 237 if (outHandle == NULL) … … 247 247 void io::pipe::close() 248 248 { 249 protector pg(this);249 pc::sync::protector pg(keeper); 250 250 251 251 #ifndef IO_WO_XEXEC … … 283 283 void io::pipe::open() 284 284 { 285 protector pg(this);285 pc::sync::protector pg(keeper); 286 286 287 287 #ifndef IO_WO_XEXEC … … 506 506 void io::pipe::flush() 507 507 { 508 protector pg(this);508 pc::sync::protector pg(keeper); 509 509 510 510 if (outHandle == NULL) … … 523 523 io::network::__peerInfo io::pipe::peerInfo() 524 524 { 525 protector pg(this);525 pc::sync::protector pg(keeper); 526 526 527 527 if (inHandle == NULL) … … 596 596 bool io::pipe::isBlocked() 597 597 { 598 protector pg(this);598 pc::sync::protector pg(keeper); 599 599 600 600 return blocked; … … 605 605 void io::pipe::block(bool flag) 606 606 { 607 protector pg(this);607 pc::sync::protector pg(keeper); 608 608 609 609 if (inHandle == NULL && outHandle == NULL) -
trunk/src/ioString.cc
r1160 r1161 122 122 void string::clone(const string &fd) 123 123 { 124 protector pg(this);124 pc::sync::protector pg(keeper); 125 125 126 126 pos = fd.pos; … … 175 175 void string::erase() 176 176 { 177 protector pg(this);177 pc::sync::protector pg(keeper); 178 178 179 179 unsigned long pos = blockOffset ? this->pos * outSize : this->pos; -
trunk/src/pcSyncProcessDataCollection.cc
r1160 r1161 39 39 //------------------------------------------------------------------- 40 40 41 collection::collection() : shareNum(0) 41 collection::collection() : shareNum(0), 42 keeper(new section(0)) 42 43 { 43 44 } … … 47 48 collection::~collection() 48 49 { 50 delete keeper; 49 51 } 50 52 … … 53 55 unsigned long collection::add(void *data) 54 56 { 55 protector tg(this);57 pc::sync::protector pg(keeper); 56 58 57 59 pc::sync::data::__info share; … … 69 71 void collection::del(unsigned long position) 70 72 { 71 protector tg(this);73 pc::sync::protector pg(keeper); 72 74 73 75 if (getShare(position)) … … 86 88 void *data) 87 89 { 88 protector tg(this);90 pc::sync::protector pg(keeper); 89 91 90 92 if (getShare(position)) … … 102 104 const void *collection::get(unsigned long position) 103 105 { 104 protector tg(this);106 pc::sync::protector pg(keeper); 105 107 106 108 if (getShare(position)) -
trunk/src/pcSyncProtector.cc
r1111 r1161 1 1 /*************************************************************************** 2 * pcSync Stack.cc2 * pcSyncProtector.cc 3 3 * 4 4 * Sat Oct 20 11:00:55 2007 … … 28 28 */ 29 29 30 #include <libdodo/pcSync Stack.h>30 #include <libdodo/pcSyncProtector.h> 31 31 32 32 using namespace dodo::pc::sync; 33 33 34 stack::~stack()34 protector::protector(section *a_keeper) : keeper(a_keeper) 35 35 { 36 keeper->acquire(); 36 37 } 37 38 38 39 //------------------------------------------------------------------- 39 40 40 stack::protector::protector(const stack *a_parent) : parent(a_parent) 41 { 42 parent->keeper->acquire(); 43 } 44 45 //------------------------------------------------------------------- 46 47 stack::protector::~protector() 41 protector::~protector() 48 42 { 49 43 try 50 44 { 51 parent->keeper->release();45 keeper->release(); 52 46 } 53 47 catch (exception::basic &ex) -
trunk/src/pcSyncThreadDataCollection.cc
r1160 r1161 39 39 //------------------------------------------------------------------- 40 40 41 collection::collection() : shareNum(0) 41 collection::collection() : shareNum(0), 42 keeper(new section) 42 43 { 43 44 } … … 47 48 collection::~collection() 48 49 { 50 delete keeper; 49 51 } 50 52 … … 53 55 unsigned long collection::add(void *data) 54 56 { 55 protector tg(this);57 pc::sync::protector tg(keeper); 56 58 57 59 pc::sync::data::__info share; … … 69 71 void collection::del(unsigned long position) 70 72 { 71 protector tg(this);73 pc::sync::protector tg(keeper); 72 74 73 75 if (getShare(position)) … … 86 88 void *data) 87 89 { 88 protector tg(this);90 pc::sync::protector tg(keeper); 89 91 90 92 if (getShare(position)) … … 102 104 const void *collection::get(unsigned long position) 103 105 { 104 protector tg(this);106 pc::sync::protector tg(keeper); 105 107 106 108 if (getShare(position)) -
trunk/src/toolsLogger.cc
r1160 r1161 64 64 logger::logger() : handlersNum(0), 65 65 timeFormat(" %d/%m/%Y.%H-%M-%S: "), 66 forward(false) 66 forward(false), 67 keeper(new pc::sync::process::section) 67 68 { 68 69 } … … 72 73 logger::~logger() 73 74 { 75 delete keeper; 74 76 } 75 77 … … 79 81 io::channel *handler) 80 82 { 81 p rotector tg(this);83 pc::sync::protector pg(keeper); 82 84 83 85 __logMap lm; … … 96 98 void logger::remove(unsigned long position) 97 99 { 98 p rotector tg(this);100 pc::sync::protector pg(keeper); 99 101 100 102 dodoList<__logMap>::iterator i(handlers.begin()), j(handlers.end()); … … 115 117 const dodoString &msg) 116 118 { 117 p rotector tg(this);119 pc::sync::protector pg(keeper); 118 120 119 121 if (level < 0 && level >= LOGGER_LEVELS) -
trunk/tests/pcprocesscollection_test/test.cc
r1142 r1161 13 13 #include <libdodo/pcSyncProcessDataSingle.h> 14 14 #include <libdodo/pcSyncProcessDataCollection.h> 15 #include <libdodo/pcSyncProtector.h> 15 16 16 17 #include <iostream> … … 47 48 cout << "Data: " << dt << endl, cout.flush(); 48 49 shD.close(); 49 50 50 51 cout << (char *)dgC.get(dgCI), cout.flush(); 51 52 52 53 cout << (char *)dg0.acquire(1), cout.flush(); 53 54 tools::os::microSleep(1000); … … 72 73 processLocked(void *ud) 73 74 { 74 s ec.acquire();75 75 sync::protector pg(&sec); 76 76 77 cout << "processLocked:" << (char *)ud << endl, cout.flush(); 77 78 … … 84 85 char *dt = (char *)shD.map(size); 85 86 cout << "Data: " << dt << endl, cout.flush(); 86 87 87 88 cout << (char *)dgC.get(dgCI), cout.flush(); 88 89 89 90 cout << (char *)dg0.acquire(), cout.flush(); 90 91 dg0.release(); … … 93 94 94 95 tools::os::sleep(1); 95 96 96 97 cout << (char *)dg1.acquire(), cout.flush(); 97 98 dg1.release(); … … 103 104 cout << (dodoString)ex << ex.line << endl, cout.flush(); 104 105 } 105 106 sec.release();107 106 108 107 return 0;
Note: See TracChangeset
for help on using the changeset viewer.
