Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/kern



On 24.10.2011 03:53, YAMAMOTO Takashi wrote:
Log Message:
Turn a workqueue(9) name into an array in the struct workqueue, rather
than a const char *. This avoids keeping a reference to a string
owned by caller (string could be allocated on stack).

what needs it?

Me, in a not-so-distant future. The purpose of this change is to allow passing strings that could be constructed that way:

char name[16];
...
snprintf(name, sizeof(name), "xbdback%d.%d", domid, instance);
workqueue_create(&foo, name, funcfoo, NULL, PRI_NONE, SPL_BIO, 0);

I'd like to construct workqueues based on a context; the old code does not permit that, unless you build and store the string somewhere, forcing the caller to *know* that it only keeps a pointer and does not copy the content. This will get misused, sooner or later.

--
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index