Changeset ab9378b4 in mainline
- Timestamp:
- 2011-12-16T18:27:50Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e1c6dde9
- Parents:
- 0edaf0f6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/generic/packet_remote.c
r0edaf0f6 rab9378b4 38 38 #include <async.h> 39 39 #include <errno.h> 40 #include <fibril_synch.h> 40 41 #include <ipc/packet.h> 41 42 #include <sys/mman.h> … … 46 47 #include <net/packet.h> 47 48 #include <net/packet_header.h> 49 50 static FIBRIL_MUTEX_INITIALIZE(packet_return_lock); 48 51 49 52 /** Obtain the packet from the packet server as the shared memory block. … … 66 69 packet_id_t packet_id, size_t size) 67 70 { 71 /* 72 * Prevent racing for address space with other invocations 73 * of packet_return(). 74 * 75 * XXX This of course does not prevent us racing with other 76 * competitors for address space mapping. 77 */ 78 fibril_mutex_lock(&packet_return_lock); 68 79 *packet = (packet_t *) as_get_mappable_page(size); 69 80 … … 79 90 if (rc != EOK) { 80 91 munmap(*packet, size); 92 fibril_mutex_unlock(&packet_return_lock); 81 93 return rc; 82 94 } … … 85 97 if (rc != EOK) { 86 98 munmap(*packet, size); 99 fibril_mutex_unlock(&packet_return_lock); 87 100 return rc; 88 101 } 89 102 103 fibril_mutex_unlock(&packet_return_lock); 90 104 return result; 91 105 }
Note:
See TracChangeset
for help on using the changeset viewer.