+ struct inotify_event* event = (struct inotify_event*)byte;
+ byte += sizeof(*event) + event->len;
+
+ hash<int,resource_weakptr,hash_function>::iterator it;
+ it = watch_list.table.find(event->wd);
+ if (it != watch_list.table.end())
+ {
+ resource_ptr rsrc = (*it).second.lock();
+ if (rsrc)
+ {
+ rsrc->reload();
+ ++count;
+
+ if (event->mask & IN_IGNORED)
+ {
+ watch_list.table.erase(event->wd);
+ rsrc->wd_ = watch_list.add(rsrc);
+ }
+ }
+ else
+ {
+ // if we can't lock the resource, it was unloaded so we
+ // don't need to watch it anymore
+ watch_list.table.erase(event->wd);
+ }
+ }