Refactor UtilServerTs() -> UtilTsMillis().
The old name was a remnant from when Cytoplasm was still a part of Telodendria, a *server*. Since Cytoplasm is no longer strictly a server support library, this function name doesn't make sense.
This commit is contained in:
parent
25ccf339fc
commit
f2e8334faf
6 changed files with 8 additions and 8 deletions
|
@ -85,7 +85,7 @@ CronThread(void *args)
|
||||||
|
|
||||||
pthread_mutex_lock(&cron->lock);
|
pthread_mutex_lock(&cron->lock);
|
||||||
|
|
||||||
ts = UtilServerTs();
|
ts = UtilTsMillis();
|
||||||
|
|
||||||
for (i = 0; i < ArraySize(cron->jobs); i++)
|
for (i = 0; i < ArraySize(cron->jobs); i++)
|
||||||
{
|
{
|
||||||
|
@ -103,7 +103,7 @@ CronThread(void *args)
|
||||||
Free(job);
|
Free(job);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
te = UtilServerTs();
|
te = UtilTsMillis();
|
||||||
|
|
||||||
pthread_mutex_unlock(&cron->lock);
|
pthread_mutex_unlock(&cron->lock);
|
||||||
|
|
||||||
|
|
2
src/Db.c
2
src/Db.c
|
@ -587,7 +587,7 @@ DbLockFromArr(Db * db, Array * args)
|
||||||
|
|
||||||
if (db->cache)
|
if (db->cache)
|
||||||
{
|
{
|
||||||
ref->ts = UtilServerTs();
|
ref->ts = UtilTsMillis();
|
||||||
ref->size = DbComputeSize(ref->json);
|
ref->size = DbComputeSize(ref->json);
|
||||||
HashMapSet(db->cache, hash, ref);
|
HashMapSet(db->cache, hash, ref);
|
||||||
db->cacheSize += ref->size;
|
db->cacheSize += ref->size;
|
||||||
|
|
|
@ -488,7 +488,7 @@ HttpServerWorkerThread(void *args)
|
||||||
* TODO: Instead of looping, abort immediately, and place the request
|
* TODO: Instead of looping, abort immediately, and place the request
|
||||||
* at the end of the queue.
|
* at the end of the queue.
|
||||||
*/
|
*/
|
||||||
firstRead = UtilServerTs();
|
firstRead = UtilTsMillis();
|
||||||
while ((lineLen = UtilGetLine(&line, &lineSize, fp)) == -1
|
while ((lineLen = UtilGetLine(&line, &lineSize, fp)) == -1
|
||||||
&& errno == EAGAIN)
|
&& errno == EAGAIN)
|
||||||
{
|
{
|
||||||
|
@ -496,7 +496,7 @@ HttpServerWorkerThread(void *args)
|
||||||
|
|
||||||
// If the server is stopped, or it's been a while, just
|
// If the server is stopped, or it's been a while, just
|
||||||
// give up so we aren't wasting a thread on this client.
|
// give up so we aren't wasting a thread on this client.
|
||||||
if (server->stop || (UtilServerTs() - firstRead) > (1000 * 30))
|
if (server->stop || (UtilTsMillis() - firstRead) > (1000 * 30))
|
||||||
{
|
{
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ RandIntN(uint32_t *buf, size_t size, uint32_t max)
|
||||||
if (!state)
|
if (!state)
|
||||||
{
|
{
|
||||||
/* Generate a seed from the system time, PID, and TID */
|
/* Generate a seed from the system time, PID, and TID */
|
||||||
uint64_t ts = UtilServerTs();
|
uint64_t ts = UtilTsMillis();
|
||||||
uint32_t seed = ts ^ getpid() ^ (unsigned long) pthread_self();
|
uint32_t seed = ts ^ getpid() ^ (unsigned long) pthread_self();
|
||||||
|
|
||||||
state = Malloc(sizeof(RandState));
|
state = Malloc(sizeof(RandState));
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint64_t
|
uint64_t
|
||||||
UtilServerTs(void)
|
UtilTsMillis(void)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
* overflow before it even gets to this function, which will cause this
|
* overflow before it even gets to this function, which will cause this
|
||||||
* function to produce unexpected results.
|
* function to produce unexpected results.
|
||||||
*/
|
*/
|
||||||
extern uint64_t UtilServerTs(void);
|
extern uint64_t UtilTsMillis(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use
|
* Use
|
||||||
|
|
Loading…
Reference in a new issue