MCPcopy Create free account
hub / github.com/F-Stack/f-stack / counted_warning

Function counted_warning

freebsd/kern/subr_prf.c:1236–1254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1234
1235#ifdef _KERNEL
1236void
1237counted_warning(unsigned *counter, const char *msg)
1238{
1239 struct thread *td;
1240 unsigned c;
1241
1242 for (;;) {
1243 c = *counter;
1244 if (c == 0)
1245 break;
1246 if (atomic_cmpset_int(counter, c, c - 1)) {
1247 td = curthread;
1248 log(LOG_INFO, "pid %d (%s) %s%s\n",
1249 td->td_proc->p_pid, td->td_name, msg,
1250 c > 1 ? "" : " - not logging anymore");
1251 break;
1252 }
1253 }
1254}
1255#endif
1256
1257#ifdef _KERNEL

Callers 1

aio_queue_fileFunction · 0.85

Calls 1

logFunction · 0.70

Tested by

no test coverage detected