Fossil

Check-in [4695f217]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the code for obtaining process ids on windows.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | backoffice
Files: files | file ages | folders
SHA3-256: 4695f217ce5e1bd7df1b5947331bc12fbb25dc8226062131f670211d96c3d24d
User & Date: drh 2018-07-18 16:54:28
Context
2018-07-18
16:58
Add the concept of "backoffice" processing, used to do background cleanup operations after repository changes, such sending alerts and/or syncing to peer repositories. check-in: 947081aa user: drh tags: trunk
16:54
Fix the code for obtaining process ids on windows. Closed-Leaf check-in: 4695f217 user: drh tags: backoffice
16:43
Add the backoffice module for doing post-processing actions such as sending alerts and/or syncing repositories. check-in: 86b43a46 user: drh tags: backoffice
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/backoffice.c.

37
38
39
40
41
42
43
44


45
46
47
48
49
50
51
...
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
** process table, doing nothing on rarely accessed repositories, and
** if the Fossil binary is updated on a system, the backoffice processes
** will restart using the new binary automatically.
*/
#include "config.h"
#include "backoffice.h"
#include <time.h>
#if !defined(_WIN32)


# include <sys/types.h>
# include <signal.h>
#endif

/*
** The BKOFCE_LEASE_TIME is the amount of time for which a single backoffice
** processing run is valid.  Each backoffice run monopolizes the lease for
................................................................................
}

/*
** Return a process id number for the current process
*/
static sqlite3_uint64 backofficeProcessId(void){
#if defined(_WIN32)
  ULONG Id = 0;
  GetCurrentProcessId(&Id);
  return Id;
#else
  return getpid();
#endif
}

/*
** COMMAND: test-process-id
**
** Usage: %fossil [--sleep N] PROCESS-ID ...







|
>
>







 







<
|
<

|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
...
141
142
143
144
145
146
147

148

149
150
151
152
153
154
155
156
157
** process table, doing nothing on rarely accessed repositories, and
** if the Fossil binary is updated on a system, the backoffice processes
** will restart using the new binary automatically.
*/
#include "config.h"
#include "backoffice.h"
#include <time.h>
#if defined(_WIN32)
# include <windows.h>
#else
# include <sys/types.h>
# include <signal.h>
#endif

/*
** The BKOFCE_LEASE_TIME is the amount of time for which a single backoffice
** processing run is valid.  Each backoffice run monopolizes the lease for
................................................................................
}

/*
** Return a process id number for the current process
*/
static sqlite3_uint64 backofficeProcessId(void){
#if defined(_WIN32)

  return (sqlite3_uint64)GetCurrentProcessId();

#else
  return (sqlite3_uint64)getpid();
#endif
}

/*
** COMMAND: test-process-id
**
** Usage: %fossil [--sleep N] PROCESS-ID ...