From 80d899385e2bd75bd1c48b0b572a2a0c05d8a32f Mon Sep 17 00:00:00 2001 From: John Cage <58808125+coshcage@users.noreply.github.com> Date: Sun, 5 May 2024 02:00:48 -0700 Subject: [PATCH] Delete Samples/10000.cc --- Samples/10000.cc | 50 ------------------------------------------------ 1 file changed, 50 deletions(-) delete mode 100644 Samples/10000.cc diff --git a/Samples/10000.cc b/Samples/10000.cc deleted file mode 100644 index 091d76a..0000000 --- a/Samples/10000.cc +++ /dev/null @@ -1,50 +0,0 @@ -#include "svimrdb.h" -#include - -int main() -{ - int i, * p = &i; - P_TRANS ptrans; - P_TABLE ptbl; - P_ARRAY_Z parrhdr; - P_ARRAY_Z parrg; - - parrg = strCreateArrayZ(1, sizeof(void *)); - - parrhdr = strCreateArrayZ(1, sizeof(TBLHDR)); - ((TBLHDR *)strLocateItemArrayZ(parrhdr, sizeof(TBLHDR), 0))->ct = CT_INTEGER; - ((TBLHDR *)strLocateItemArrayZ(parrhdr, sizeof(TBLHDR), 0))->phsh = NULL; - ((TBLHDR *)strLocateItemArrayZ(parrhdr, sizeof(TBLHDR), 0))->cr = CR_PRIMARY_KEY; - ((TBLHDR *)strLocateItemArrayZ(parrhdr, sizeof(TBLHDR), 0))->strname = "number"; - - strInsertItemArrayZ(parrg, &p, sizeof(void *), 0); - - ptrans = siBeginTransaction(); - - ptbl = siCreateTable(ptrans, "Student", parrhdr); - - while (TRUE != siTrylock(ptrans, ptbl, LT_S)) // Share lock. - ; - - while (TRUE != siTrylock(ptrans, ptbl, LT_X)) // Write lock. - ; - - for (i = 0; i < 10000; ++i) - { - if (TRUE != siInsertIntoTableBase(ptrans, ptbl, NULL, parrg)) - { - printf("%s, %d\n", "failed!", i); - siRollbackTransaction(NULL, ptrans); - siReleaseAllTransaction(); - return 1; - } - } - - siCommitTransaction(ptrans); - - siReleaseAllTransaction(); - - strDeleteArrayZ(parrg); - - return 0; -}