/ Check-in [79057716]
Login

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

Overview
Comment:Make fine time granularity work on POSIX.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | mutexDbg2
Files: files | file ages | folders
SHA1: 79057716d9ab9e05acdc1f204940ddd540a8f2ef
User & Date: mistachkin 2017-02-15 00:45:53
Context
2017-02-15
00:52
Another compilation fix for POSIX. check-in: 82ef47ea user: mistachkin tags: mutexDbg2
00:45
Make fine time granularity work on POSIX. check-in: 79057716 user: mistachkin tags: mutexDbg2
00:02
Compilation fix for POSIX. check-in: 9964ad24 user: mistachkin tags: mutexDbg2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/mutex.c.

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
  return rc;
}

#if SQLITE_MUTEX_ALERT_MILLISECONDS>0
/* Return a time value for use by the mutex subsystem. */
i64 sqlite3MutexTimeOfDay(void){
#ifdef SQLITE_GET_MUTEX_TIME
  return SQLITE_GET_MUTEX_TIME();
#else
  return 0;
#endif
}

/*
** Calculates the elapsed time, in milliseconds, that a particular mutex







|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
  return rc;
}

#if SQLITE_MUTEX_ALERT_MILLISECONDS>0
/* Return a time value for use by the mutex subsystem. */
i64 sqlite3MutexTimeOfDay(void){
#ifdef SQLITE_GET_MUTEX_TIME
  SQLITE_GET_MUTEX_TIME;
#else
  return 0;
#endif
}

/*
** Calculates the elapsed time, in milliseconds, that a particular mutex

Changes to src/sqliteInt.h.

3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549



3550
3551


3552
3553
3554
3555
3556
3557
3558
3559
3560
....
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
#endif

#if !defined(SQLITE_MUTEX_OMIT) && SQLITE_MUTEX_ALERT_MILLISECONDS>0
  i64 sqlite3MutexTimeOfDay(void);
  void sqlite3MutexTimeAlert(sqlite3_mutex *, i64);

/*
** This macro returns a 64-bit integer time value, in milliseconds,
** or zero if that information is not available.
*/
# ifndef SQLITE_GET_MUTEX_TIME
#  if SQLITE_OS_UNIX
#   define SQLITE_GET_MUTEX_TIME()   (((i64)time(0))*1000)



#  elif SQLITE_OS_WIN
#   define SQLITE_GET_MUTEX_TIME()   ((i64)GetTickCount())


#  else
#   define SQLITE_GET_MUTEX_TIME()   (0)
#  endif
# endif

/*
** This macro returns the integer type for the specified mutex or
** negative one if that information is not available.
*/
................................................................................
#  else
#   define SQLITE_GET_THREAD_ID()     ((void *)0)
#  endif
# endif
#else
# define sqlite3MutexTimeOfDay()      (0)
# define sqlite3MutexTimeAlert(X,Y)
# define SQLITE_GET_MUTEX_TIME()      (0)
# define SQLITE_GET_MUTEX_ID(p)       (-1)
# define SQLITE_GET_THREAD_ID()       ((void *)0)
#endif

sqlite3_int64 sqlite3StatusValue(int);
void sqlite3StatusUp(int, int);
void sqlite3StatusDown(int, int);







|
|



|
>
>
>

|
>
>

|







 







|







3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
....
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
#endif

#if !defined(SQLITE_MUTEX_OMIT) && SQLITE_MUTEX_ALERT_MILLISECONDS>0
  i64 sqlite3MutexTimeOfDay(void);
  void sqlite3MutexTimeAlert(sqlite3_mutex *, i64);

/*
** This macro contains code that returns a 64-bit integer time value,
** in milliseconds, or zero if that information is not available.
*/
# ifndef SQLITE_GET_MUTEX_TIME
#  if SQLITE_OS_UNIX
#   define SQLITE_GET_MUTEX_TIME      {                    \
        struct timeval sNow; (void)gettimeofday(&sNow, 0); \
        return 1000*(i64)sNow.tv_sec + sNow.tv_usec/1000;  \
    }
#  elif SQLITE_OS_WIN
#   define SQLITE_GET_MUTEX_TIME      { \
        return (i64)GetTickCount();     \
    }
#  else
#   define SQLITE_GET_MUTEX_TIME      (0)
#  endif
# endif

/*
** This macro returns the integer type for the specified mutex or
** negative one if that information is not available.
*/
................................................................................
#  else
#   define SQLITE_GET_THREAD_ID()     ((void *)0)
#  endif
# endif
#else
# define sqlite3MutexTimeOfDay()      (0)
# define sqlite3MutexTimeAlert(X,Y)
# define SQLITE_GET_MUTEX_TIME
# define SQLITE_GET_MUTEX_ID(p)       (-1)
# define SQLITE_GET_THREAD_ID()       ((void *)0)
#endif

sqlite3_int64 sqlite3StatusValue(int);
void sqlite3StatusUp(int, int);
void sqlite3StatusDown(int, int);