|
@@ -485,6 +485,20 @@ Error_manager Dispatch_coordinates::catcher_try_space_lock(int row_min, int colu
|
|
|
" Dispatch_coordinates::carrier_try_space_lock error ");
|
|
|
}
|
|
|
}
|
|
|
+//搬运器强制空间加锁(不做判断了, 直接加锁)
|
|
|
+Error_manager Dispatch_coordinates::carrier_force_space_lock(int row_min, int column_min, int row_max, int column_max, int carrier_id )
|
|
|
+{
|
|
|
+ //不做判断了, 直接加锁
|
|
|
+ std::unique_lock<std::mutex> t_lock(m_lock);
|
|
|
+ for (int i = row_min; i <= row_max; ++i)
|
|
|
+ {
|
|
|
+ for (int j = column_min; j <= column_max ; ++j)
|
|
|
+ {
|
|
|
+ mpp_space_lock[i][j].m_carrier_id = carrier_id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Error_code::SUCCESS;
|
|
|
+}
|
|
|
//抓取器强制空间加锁(不做判断了, 直接加锁)
|
|
|
Error_manager Dispatch_coordinates::catcher_force_space_lock(int row_min, int column_min, int row_max, int column_max, int catcher_id )
|
|
|
{
|
|
@@ -494,12 +508,7 @@ Error_manager Dispatch_coordinates::catcher_force_space_lock(int row_min, int co
|
|
|
{
|
|
|
for (int j = column_min; j <= column_max ; ++j)
|
|
|
{
|
|
|
- if ( mpp_space_lock[i][j].m_catcher_id != -1 &&
|
|
|
- mpp_space_lock[i][j].m_catcher_id != catcher_id &&
|
|
|
- mpp_space_lock[i][j].m_carrier_id != -1)
|
|
|
- {
|
|
|
- mpp_space_lock[i][j].m_catcher_id = catcher_id;
|
|
|
- }
|
|
|
+ mpp_space_lock[i][j].m_catcher_id = catcher_id;
|
|
|
}
|
|
|
}
|
|
|
return Error_code::SUCCESS;
|