From: Alexander P. <ale...@us...> - 2008-03-03 17:47:22
|
Build Version : T2.5.0.18655 Firebird 2.5 Unstable (writeBuildNum.sh,v 1.18814 2008/03/03 17:46:48 alexpeshkof ) Update of /cvsroot/firebird/firebird2/src/jrd In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv9845/src/jrd Modified Files: ibase.h svc.cpp why.cpp why_proto.h Log Message: Make fb_disconnect_transaction, fb_shutdown and fb_shutdown_callback public API calls. Related cleanup. Index: ibase.h =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/ibase.h,v retrieving revision 1.128 retrieving revision 1.129 diff -b -U3 -r1.128 -r1.129 --- ibase.h 26 Feb 2008 02:23:27 -0000 1.128 +++ ibase.h 3 Mar 2008 17:46:51 -0000 1.129 @@ -83,6 +83,7 @@ typedef void (*ISC_PRINT_CALLBACK) (void*, ISC_SHORT, const char*); typedef void (*ISC_VERSION_CALLBACK)(void*, const char*); typedef void (*ISC_EVENT_CALLBACK)(void*, ISC_USHORT, const ISC_UCHAR*); +typedef int (*FB_SHUTDOWN_CALLBACK)(); /*******************************************************************/ /* Blob id structure */ @@ -594,21 +595,23 @@ ISC_EVENT_CALLBACK, void*); -ISC_STATUS ISC_EXPORT isc_rollback_retaining(ISC_STATUS *, - isc_tr_handle *); +ISC_STATUS ISC_EXPORT isc_rollback_retaining(ISC_STATUS*, + isc_tr_handle*); -ISC_STATUS ISC_EXPORT isc_rollback_transaction(ISC_STATUS *, - isc_tr_handle *); +ISC_STATUS ISC_EXPORT isc_rollback_transaction(ISC_STATUS*, + isc_tr_handle*); -ISC_STATUS ISC_EXPORT isc_start_multiple(ISC_STATUS *, - isc_tr_handle *, +ISC_STATUS ISC_EXPORT isc_start_multiple(ISC_STATUS*, + isc_tr_handle*, short, void *); -ISC_STATUS ISC_EXPORT_VARARG isc_start_transaction(ISC_STATUS *, - isc_tr_handle *, +ISC_STATUS ISC_EXPORT_VARARG isc_start_transaction(ISC_STATUS*, + isc_tr_handle*, short, ...); +ISC_STATUS ISC_EXPORT fb_disconnect_transaction(ISC_STATUS*, isc_tr_handle*); + ISC_LONG ISC_EXPORT isc_sqlcode(const ISC_STATUS*); void ISC_EXPORT isc_sqlcode_s(const ISC_STATUS*, @@ -1125,6 +1128,12 @@ const ISC_SCHAR*); +ISC_STATUS ISC_EXPORT fb_shutdown(ISC_STATUS*); +ISC_STATUS ISC_EXPORT fb_shutdown_callback(ISC_STATUS*, + FB_SHUTDOWN_CALLBACK, + const int); + + /********************************/ /* Client information functions */ /********************************/ Index: svc.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/svc.cpp,v retrieving revision 1.209 retrieving revision 1.210 diff -b -U3 -r1.209 -r1.210 --- svc.cpp 29 Feb 2008 12:44:18 -0000 1.209 +++ svc.cpp 3 Mar 2008 17:46:52 -0000 1.210 @@ -652,8 +652,9 @@ void Service::detach() { - if (svc_do_shutdown) { - fb__shutdown(NULL); + if (svc_do_shutdown) + { + fb_shutdown(NULL); } if (svc_uses_security_database) Index: why.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/why.cpp,v retrieving revision 1.165 retrieving revision 1.166 diff -b -U3 -r1.165 -r1.166 --- why.cpp 3 Mar 2008 13:59:05 -0000 1.165 +++ why.cpp 3 Mar 2008 17:46:52 -0000 1.166 @@ -44,6 +44,7 @@ #include "firebird.h" #include "memory_routines.h" // needed for get_long +#include "consts_pub.h" #include <stdlib.h> #include <string.h> @@ -97,12 +98,6 @@ #include "../jrd/blr.h" #endif -// In 2.0 it's hard to include ibase.h in why.cpp due to API declaration conflicts. -// Taking into account that given y-valve lives it's last version, -// in which dpb version is not likely to change, define it here. -// #include "../jrd/ibase.h" -const UCHAR isc_dpb_version1 = 1; - #ifdef HAVE_ERRNO_H #include <errno.h> #endif @@ -836,18 +831,7 @@ // perform shutdown ISC_STATUS_ARRAY status; - fb__shutdown(status); - - if (status[0] == 1 && status[1] != 0) - { - char buffer[256]; - const ISC_STATUS *vector = status; - if (!fb_interpret(buffer, sizeof(buffer), &vector)) - { - strcpy(buffer, "Unknown failure in shutdown thread in fb__shutdown()"); - } - gds__log(buffer, 0); - } + fb_shutdown(NULL); } return 0; @@ -3842,7 +3826,7 @@ } -ISC_STATUS API_ROUTINE gds__handle_cleanup(ISC_STATUS* user_status, +ISC_STATUS API_ROUTINE fb_disconnect_transaction(ISC_STATUS* user_status, FB_API_HANDLE* user_handle) { /************************************** @@ -3852,7 +3836,7 @@ ************************************** * * Functional description - * Clean up a dangling y-valve handle. + * Clean up a dangling transaction handle. * **************************************/ Status status(user_status); @@ -3861,7 +3845,8 @@ { Transaction* transaction = translate<Transaction>(user_handle); - while (transaction) { + while (transaction) + { Transaction* sub = transaction; transaction = sub->next; delete sub; @@ -6073,7 +6058,7 @@ #endif // !SUPERCLIENT -ISC_STATUS API_ROUTINE fb__shutdown(ISC_STATUS* user_status) +ISC_STATUS API_ROUTINE fb_shutdown(ISC_STATUS* user_status) { /************************************** * @@ -6090,7 +6075,7 @@ try { // Shutdown clients before providers - if (ShutChain::run(FB_SHUT_PREPROVIDERS) == 0) + if (ShutChain::run(fb_shut_preproviders) == 0) { // Shutdown providers ISC_STATUS* curStatus = status; @@ -6112,7 +6097,7 @@ } // Shutdown clients after providers - if (ShutChain::run(FB_SHUT_POSTPROVIDERS) == 0) + if (ShutChain::run(fb_shut_postproviders) == 0) { // All clients are ready to exit exit(0); @@ -6128,7 +6113,7 @@ } -ISC_STATUS API_ROUTINE fb__shutdown_callback(ISC_STATUS* user_status, FPTR_INT callBack, const int mask) +ISC_STATUS API_ROUTINE fb_shutdown_callback(ISC_STATUS* user_status, FPTR_INT callBack, const int mask) { /************************************** * Index: why_proto.h =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/why_proto.h,v retrieving revision 1.42 retrieving revision 1.43 diff -b -U3 -r1.42 -r1.43 --- why_proto.h 1 Mar 2008 19:14:46 -0000 1.42 +++ why_proto.h 3 Mar 2008 17:46:53 -0000 1.43 @@ -255,11 +255,11 @@ #define CANCEL_enable 2 #define CANCEL_raise 3 ISC_STATUS API_ROUTINE gds__cancel_operation(ISC_STATUS*, FB_API_HANDLE*, USHORT); -ISC_STATUS API_ROUTINE gds__handle_cleanup(ISC_STATUS*, FB_API_HANDLE*); -ISC_STATUS API_ROUTINE fb__shutdown(ISC_STATUS* user_status); -const int FB_SHUT_PREPROVIDERS = 1; -const int FB_SHUT_POSTPROVIDERS = 2; -ISC_STATUS API_ROUTINE fb__shutdown_callback(ISC_STATUS* user_status, FPTR_INT callBack, const int mask); + +ISC_STATUS API_ROUTINE fb_disconnect_transaction(ISC_STATUS*, FB_API_HANDLE*); + +ISC_STATUS API_ROUTINE fb_shutdown(ISC_STATUS* user_status); +ISC_STATUS API_ROUTINE fb_shutdown_callback(ISC_STATUS* user_status, FPTR_INT callBack, const int mask); typedef void AttachmentCleanupRoutine(FB_API_HANDLE*, void*); typedef void TransactionCleanupRoutine(FB_API_HANDLE, void*); |