~ubuntu-branches/ubuntu/hardy/steam/hardy

« back to all changes in this revision

Viewing changes to sources/wiki/globals.h

  • Committer: Bazaar Package Importer
  • Author(s): Alain Schroeder
  • Date: 2006-11-21 16:03:12 UTC
  • mfrom: (2.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061121160312-nf96y6nihzsyd2uv
Tags: 2.2.31-3
Add patch to prevent inconsistent data after shutdown.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
} Global;
33
33
 
34
 
#define CALLBACK_API_SIZE 7
 
34
#define CALLBACK_API_SIZE 10
35
35
#define cb_annotation    0x00
36
36
#define cb_linkInternal  0x01
37
37
#define cb_image         0x02
39
39
#define cb_barelink      0x04
40
40
#define cb_embed         0x05
41
41
#define cb_pike          0x06
 
42
#define cb_tag           0x07
 
43
#define cb_heading       0x08
 
44
#define cb_math          0x09
42
45
 
43
46
 
44
47
typedef struct 
54
57
 
55
58
} wiki_store;
56
59
 
 
60
#if defined(PIKE_THREADS) && defined(_REENTRANT)
 
61
#define THREAD_SAFE_RUN(COMMAND)  do {\
 
62
  struct thread_state *state;\
 
63
 if((state = thread_state_for_id(th_self()))!=NULL) {\
 
64
    if(!state->swapped) {\
 
65
      COMMAND;\
 
66
    } else {\
 
67
      mt_lock(&interpreter_lock);\
 
68
      SWAP_IN_THREAD(state);\
 
69
      COMMAND;\
 
70
      SWAP_OUT_THREAD(state);\
 
71
      mt_unlock(&interpreter_lock);\
 
72
    }\
 
73
  }\
 
74
} while(0)
 
75
#else
 
76
#define THREAD_SAFE_RUN(COMMAND) COMMAND
 
77
#endif
57
78
 
58
79
 
59
80
#endif