source: SHX/trunk/sandbox/double.py @ 265

Revision 265, 630 bytes checked in by marcus, 10 years ago (diff)

showing that a shared lib is loaded only once in a process

  • Property svn:eol-style set to native
Line 
1import ctypes as C
2
3a = C.CDLL("/usr/share/SH/sh/libshc.so", mode=C.RTLD_GLOBAL)
4b = C.CDLL("/usr/share/SH/sh/libshc.so", mode=C.RTLD_GLOBAL)
5
6status= C.c_int()
7CSTR_ARRAY = C.c_char_p * 1
8argv = CSTR_ARRAY("")
9
10a.GpReadParfile()
11a.se_initialize(len(argv), argv, C.byref(status))
12
13b.GpReadParfile()
14b.se_initialize(len(argv), argv, C.byref(status))
15
16#a.se_terminate()
17
18#a.qf_close(C.byref(status))
19#b.qf_close(C.byref(status))
20
21str = C.create_string_buffer("SH_LAST.SHC")
22a.sy_fdelete(str);
23
24print "1st"
25a.ui_exit(str)
26print "2nd"
27#b.ui_exit(str)
28print "done"
29
30#b.se_terminate()
31
32a.SqlDeleteScratchFile()
33b.SqlDeleteScratchFile()
Note: See TracBrowser for help on using the repository browser.