return job;
}
-static int __set_comm(const char *name)
-{
- int fd;
- ssize_t bytes_written;
- char path[PATH_MAX];
- pid_t tid = syscall(__NR_gettid);
-
- _I("[%s] TID(%d)", name, tid);
- snprintf(path, sizeof(path), "/proc/%d/comm", tid);
- fd = open(path, O_WRONLY);
- if (fd < 0) {
- _E("Failed to open %s. error(%d)", path, errno);
- return -1;
- }
-
- bytes_written = write(fd, name, strlen(name) + 1);
- if (bytes_written < 0) {
- _E("Failed to write name(%s)", name);
- close(fd);
- return -1;
- }
-
- close(fd);
-
- return 0;
-}
-
static GIOCondition __convert_aul_io_condition(int condition)
{
GIOCondition cond = 0;
GSource *source;
g_mutex_lock(&worker->mutex);
- __set_comm(worker->name);
+ pthread_setname_np(pthread_self(), worker->name);
source = g_idle_source_new();
if (!source) {