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:
Jordan Bancino 2024-01-13 14:21:18 -05:00
parent 25ccf339fc
commit f2e8334faf
6 changed files with 8 additions and 8 deletions

View file

@ -85,7 +85,7 @@ CronThread(void *args)
pthread_mutex_lock(&cron->lock);
ts = UtilServerTs();
ts = UtilTsMillis();
for (i = 0; i < ArraySize(cron->jobs); i++)
{
@ -103,7 +103,7 @@ CronThread(void *args)
Free(job);
}
}
te = UtilServerTs();
te = UtilTsMillis();
pthread_mutex_unlock(&cron->lock);

View file

@ -587,7 +587,7 @@ DbLockFromArr(Db * db, Array * args)
if (db->cache)
{
ref->ts = UtilServerTs();
ref->ts = UtilTsMillis();
ref->size = DbComputeSize(ref->json);
HashMapSet(db->cache, hash, ref);
db->cacheSize += ref->size;

View file

@ -488,7 +488,7 @@ HttpServerWorkerThread(void *args)
* TODO: Instead of looping, abort immediately, and place the request
* at the end of the queue.
*/
firstRead = UtilServerTs();
firstRead = UtilTsMillis();
while ((lineLen = UtilGetLine(&line, &lineSize, fp)) == -1
&& errno == EAGAIN)
{
@ -496,7 +496,7 @@ HttpServerWorkerThread(void *args)
// If the server is stopped, or it's been a while, just
// 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;
}

View file

@ -141,7 +141,7 @@ RandIntN(uint32_t *buf, size_t size, uint32_t max)
if (!state)
{
/* 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();
state = Malloc(sizeof(RandState));

View file

@ -49,7 +49,7 @@
#endif
uint64_t
UtilServerTs(void)
UtilTsMillis(void)
{
struct timeval tv;

View file

@ -60,7 +60,7 @@
* overflow before it even gets to this function, which will cause this
* function to produce unexpected results.
*/
extern uint64_t UtilServerTs(void);
extern uint64_t UtilTsMillis(void);
/**
* Use